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

@@ -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,