Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
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
- Host: GitHub
- URL: https://github.com/mateioprea/react-native-observable-hooks-focus-subscription-plugin
- Owner: mateioprea
- License: mit
- Created: 2024-03-15T10:04:28.000Z (10 months ago)
- Default Branch: main
- Last Pushed: 2024-03-15T11:22:20.000Z (10 months ago)
- Last Synced: 2024-11-22T22:50:09.317Z (about 2 months ago)
- Language: TypeScript
- Size: 1.39 MB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
- Code of conduct: CODE_OF_CONDUCT.md
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)