Reverted commit D3339945

Summary: Updated networking and geolocation to use the new events system.

Reviewed By: javache

Differential Revision: D3339945

fbshipit-source-id: 01d307cf8a0aea3a404c87c6205132c42290abb1
This commit is contained in:
Konstantin Raev
2016-05-24 12:33:57 -07:00
committed by Facebook Github Bot 6
parent 8876eaaea0
commit 2de0323182
27 changed files with 340 additions and 229 deletions

View File

@@ -12,14 +12,12 @@
'use strict';
const Map = require('Map');
const NativeEventEmitter = require('NativeEventEmitter');
const NativeModules = require('NativeModules');
const Platform = require('Platform');
const RCTDeviceEventEmitter = require('RCTDeviceEventEmitter');
const RCTNetInfo = NativeModules.NetInfo;
const deprecatedCallback = require('deprecatedCallback');
const NetInfoEventEmitter = new NativeEventEmitter(RCTNetInfo);
const DEVICE_CONNECTIVITY_EVENT = 'networkStatusDidChange';
type ChangeEventName = $Enum<{
@@ -178,7 +176,7 @@ const NetInfo = {
eventName: ChangeEventName,
handler: Function
): {remove: () => void} {
const listener = NetInfoEventEmitter.addListener(
const listener = RCTDeviceEventEmitter.addListener(
DEVICE_CONNECTIVITY_EVENT,
(appStateData) => {
handler(appStateData.network_info);