Focus Effect observable hook for react native
yarn add react-native-observable-hooks-focus-subscription-plugin @react-navigation/native observable-hooks rxjs
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 (
<View>
<Text>My Screen</Text>
</View>
)
}
See the contributing guide to learn how to contribute to the repository and the development workflow.
MIT
Made with create-react-native-library