0.1.2 • Published 6 months ago

react-native-appstate-emitter-listener v0.1.2

Weekly downloads
-
License
MIT
Repository
github
Last release
6 months ago

react-native-appstate-emitter-listener

Listen to Appstate change

Installation

npm install react-native-appstate-emitter-listener

Usage

import {
  addEventListener,
  initActivityListener,
} from 'react-native-appstate-emitter-listener';

// ...

//To init android activity listener
initActivityListener();

//listenable states are: 'change' | 'activityChange' | 'window'
addEventListener('change', (e) => {
  console.log('state changed:', e);
  setState(e.state);
});

Contributing

See the contributing guide to learn how to contribute to the repository and the development workflow.

License

MIT


Made with create-react-native-library

0.1.2

6 months ago

0.1.1

6 months ago