function addEventListener(eventName, listener) {
  if (typeof listener !== 'function') {
    warn('NetInfo listener is not a function');
    return;
  }
  let event = eventName;
  if (event === 'change') {
    event = DEVICE_CONNECTIVITY_EVENT;
  }
  if (subscriptions.size === 0) {
    Native.callNative('NetInfo', 'addListener', event);
  }
  if (!app) {
    app = getApp();
  }
  app.$on(
    event,
    listener,
  );
  subscriptions.set(listener, listener);
  return new NetInfoRevoker(event, listener);
}
/**
 * Add a network status event listener
 *
 * @param {string} eventName - Event name will listen for NetInfo module,
 *                             use `change` for listen network change.
 * @param {function} listener - Event status event callback
 * @returns {object} NetInfoRevoker - The event revoker for destroy the network info event listener.
 */
Add a network status event listener
@param {string} eventName - Event name will listen for NetInfo module,
use `change` for listen network change.
@param {function} listener - Event status event callback
@returns {object} NetInfoRevoker - The event revoker for destroy the network info event listener.
Add a network status event listener @param { string } eventName - Event name will listen for NetInfo module use ` change ` for listen network change . @param { function } listener - Event status event callback @returns { object } NetInfoRevoker - The event revoker for destroy the network info event listener .
function addEventListener(eventName, listener) {
  if (typeof listener !== 'function') {
    warn('NetInfo listener is not a function');
    return;
  }
  let event = eventName;
  if (event === 'change') {
    event = DEVICE_CONNECTIVITY_EVENT;
  }
  if (subscriptions.size === 0) {
    Native.callNative('NetInfo', 'addListener', event);
  }
  if (!app) {
    app = getApp();
  }
  app.$on(
    event,
    listener,
  );
  subscriptions.set(listener, listener);
  return new NetInfoRevoker(event, listener);
}
function addEventListener ( eventName , listener ) { if ( typeof listener !== 'function' ) { warn ( 'NetInfo listener is not a function' ) ; return ; } let event = eventName ; if ( event === 'change' ) { event = DEVICE_CONNECTIVITY_EVENT ; } if ( subscriptions . size === 0 ) { Native . callNative ( 'NetInfo' , 'addListener' , event ) ; } if ( ! app ) { app = getApp ( ) ; } app . $on ( event , listener , ) ; subscriptions . set ( listener , listener ) ; return new NetInfoRevoker ( event , listener ) ; }
Add a network status event listener
 @param {string} eventName - Event name will listen for NetInfo module,
                             use `change` for listen network change.
Add a network status event listener @param { string } eventName - Event name will listen for NetInfo module use ` change ` for listen network change .