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

https://github.com/rxreactnative/react-native-rxemitter

emit: support React-Native / Vue / Nuxt. (广播、通知)
https://github.com/rxreactnative/react-native-rxemitter

nuxt react react-native react-native-web vue

Last synced: 3 months ago
JSON representation

emit: support React-Native / Vue / Nuxt. (广播、通知)

Awesome Lists containing this project

README

          

# react-native-rxemitter

React-Native / Vue / Nuxt

: `Broadcast notification` - `广播`


```sh
npm install react-native-rxemitter --save-dev

# or
yarn add react-native-rxemitter --dev
```

## Usage

```js
//- - - -
// 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');
```