mirror of
https://github.com/zhigang1992/react-native.git
synced 2026-06-13 08:10:30 +08:00
Summary: Updated networking and geolocation to use the new events system. Reviewed By: javache Differential Revision: D3339945 fbshipit-source-id: 01d307cf8a0aea3a404c87c6205132c42290abb1
31 lines
746 B
JavaScript
31 lines
746 B
JavaScript
/**
|
|
* Copyright (c) 2015-present, Facebook, Inc.
|
|
* All rights reserved.
|
|
*
|
|
* This source code is licensed under the BSD-style license found in the
|
|
* LICENSE file in the root directory of this source tree. An additional grant
|
|
* of patent rights can be found in the PATENTS file in the same directory.
|
|
*
|
|
* @providesModule RCTNetworking
|
|
*/
|
|
'use strict';
|
|
|
|
var RCTNetworkingNative = require('NativeModules').Networking;
|
|
|
|
/**
|
|
* This class is a wrapper around the native RCTNetworking module.
|
|
*/
|
|
class RCTNetworking {
|
|
|
|
static sendRequest(query, callback) {
|
|
RCTNetworkingNative.sendRequest(query, callback);
|
|
}
|
|
|
|
static abortRequest(requestId) {
|
|
RCTNetworkingNative.cancelRequest(requestId);
|
|
}
|
|
|
|
}
|
|
|
|
module.exports = RCTNetworking;
|