Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/mateioprea/react-native-observable-hooks-focus-subscription-plugin

Focus Effect observable hook for react native
https://github.com/mateioprea/react-native-observable-hooks-focus-subscription-plugin

Last synced: about 1 month ago
JSON representation

Focus Effect observable hook for react native

Awesome Lists containing this project

README

        

# react-native-observable-hooks-focus-subscription-plugin

Focus Effect observable hook for react native

Inspired from [Observable hooks](https://observable-hooks.js.org/) project

## Installation

```sh
yarn add react-native-observable-hooks-focus-subscription-plugin @react-navigation/native observable-hooks rxjs
```

## Usage

```javascript

import { useFocusSubscription } from 'react-native-observable-hooks-focus-subscription-plugin';

const MyScreen = () => {

const count$ = interval(1000)
const observer = {
next: (value: number) => {
console.log(value)
},
}

useFocusSubscription(count$, observer)

return (

My Screen

)
}
```

## Contributing

See the [contributing guide](CONTRIBUTING.md) to learn how to contribute to the repository and the development workflow.

## License

MIT

---

Made with [create-react-native-library](https://github.com/callstack/react-native-builder-bob)