mirror of
https://github.com/zhigang1992/react-native.git
synced 2026-04-24 04:16:00 +08:00
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:
committed by
Facebook Github Bot 6
parent
8876eaaea0
commit
2de0323182
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user