Package Exports
- react-native-rxemitter
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (react-native-rxemitter) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
react-native-rxemitter
React-Native / Vue / Nuxt
: Broadcast notification
- 广播
npm install react-native-rxemitter --save-dev
# or
yarn add react-native-rxemitter --dev
Usage
//- - - -
// add listener (React -> componentDidMount)
// (Vue/Nuxt -> created)
RXEmitter.addListener(this, 'gotoHome', ()=>{
// ...
});
// remove listener (React -> componentWillUnmount)
// (Vue/Nuxt -> destroyed)
RXEmitter.remove(this, 'gotoHome');
//- - - -
// send eitter (anywhere)
RXEmitter.emit('gotoHome');