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
@@ -11,16 +11,15 @@
|
||||
*/
|
||||
'use strict';
|
||||
|
||||
const NativeEventEmitter = require('NativeEventEmitter');
|
||||
const RCTLocationObserver = require('NativeModules').LocationObserver;
|
||||
var RCTDeviceEventEmitter = require('RCTDeviceEventEmitter');
|
||||
var RCTLocationObserver = require('NativeModules').LocationObserver;
|
||||
|
||||
const invariant = require('fbjs/lib/invariant');
|
||||
const logError = require('logError');
|
||||
const warning = require('fbjs/lib/warning');
|
||||
|
||||
const LocationEventEmitter = new NativeEventEmitter(RCTLocationObserver);
|
||||
var invariant = require('fbjs/lib/invariant');
|
||||
var logError = require('logError');
|
||||
var warning = require('fbjs/lib/warning');
|
||||
|
||||
var subscriptions = [];
|
||||
|
||||
var updatesEnabled = false;
|
||||
|
||||
type GeoOptions = {
|
||||
@@ -81,11 +80,11 @@ var Geolocation = {
|
||||
}
|
||||
var watchID = subscriptions.length;
|
||||
subscriptions.push([
|
||||
LocationEventEmitter.addListener(
|
||||
RCTDeviceEventEmitter.addListener(
|
||||
'geolocationDidChange',
|
||||
success
|
||||
),
|
||||
error ? LocationEventEmitter.addListener(
|
||||
error ? RCTDeviceEventEmitter.addListener(
|
||||
'geolocationError',
|
||||
error
|
||||
) : null,
|
||||
|
||||
Reference in New Issue
Block a user