react-native-navigation的迁移库

NativeEventsReceiver.js 489B

1234567891011121314151617181920
  1. import { NativeModules, NativeEventEmitter } from 'react-native';
  2. export default class NativeEventsReceiver {
  3. constructor() {
  4. this.emitter = new NativeEventEmitter(NativeModules.RNNEventEmitter);
  5. }
  6. containerStart(callback) {
  7. this.emitter.addListener('RNN.containerStart', callback);
  8. }
  9. containerStop(callback) {
  10. this.emitter.addListener('RNN.containerStop', callback);
  11. }
  12. appLaunched(callback) {
  13. this.emitter.addListener('RNN.appLaunched', callback);
  14. }
  15. }