title: React Native (iOS): RCTEventEmitter before javascript is loaded
body: <p>I have a problem implementing beacons in my app. I am using the library <code>react-native-beacons-manager</code>, but I think is a general "problem". </p>
  
  <p>The issue is that when I kill my app (and this is important to reproduce the issue) and I get closer to my beacon, iOS fire an event <code>regionDidEnter</code> that is caught by a file wrote in native code, and then, sent to javascript using the method of <code>RCTEventEmitter</code>: <code>[self sendEventWithName:@"regionDidEnter" body:event];</code></p>
  
  <p>The problem is that this event is fired before javascript is fully loaded, so my listener:</p>
  
  <pre><code>// component.js
  Beacons.BeaconsEventEmitter.addListener('regionDidEnter', b =&gt; {
          //code
        });
  </code></pre>
  
  <p>doesn't get called. </p>
  
  <p>Order of events:</p>
  
  <pre><code>[BeaconsDemo] Did finish launching enter
  [BeaconsDemo] Did finish launching After jsBundleURLForBundleRoot
  [BeaconsDemo] Did finish launching After RCTRootView alloc
  [BeaconsDemo] Did finish launching After UIWindow alloc
  [BeaconsDemo] Did finish launching After makeKeyAndVisible
  [BeaconsDemo] Did finish launching end
  --iOS send the event and it is caught by RNiBeacon but it has no listeners yet--
  [BeaconsDemo] no listeners in RnIBeacon.m
  --Register
  [BeaconsDemo] regionDidExit
  -- First line of javascript --
  [BeaconsDemo] start observing
  [BeaconsDemo] requestAlwaysAuth
  </code></pre>
  
  <p>Any idea to handle this situation? Is there any way or approach to send the event through <code>RCTEventEmitter</code> waiting for the javascript is loaded?</p>
  
  <p>Thanks</p>