Pārlūkot izejas kodu

hacking some weird NativeModules behaviour

Daniel Zlotin 6 gadus atpakaļ
vecāks
revīzija
2bb15524e2
1 mainītis faili ar 2 papildinājumiem un 2 dzēšanām
  1. 2
    2
      lib/src/adapters/NativeEventsReceiver.ts

+ 2
- 2
lib/src/adapters/NativeEventsReceiver.ts Parādīt failu

@@ -5,9 +5,9 @@ import { EventSubscription } from '../interfaces/EventSubscription';
5 5
 export class NativeEventsReceiver {
6 6
   private emitter;
7 7
   constructor() {
8
-    if (NativeModules.RNNEventEmitter) {
8
+    try {
9 9
       this.emitter = new NativeEventEmitter(NativeModules.RNNEventEmitter);
10
-    } else {
10
+    } catch (e) {
11 11
       console.log('Using mock NativeEventEmitter module');
12 12
       this.emitter = {
13 13
         addListener: () => {