react-native/Libraries/Network/RCTNetworking.ios.js
Kevin Gozali 18cd0953c2 ensure that RCTNetworking JS function names are consistent with android
Summary: public

Recent refactoring of `XMLHttpRequestBase` made use of `abortRequest` instead of the existing `cancelRequest` in iOS. This will simply alias `abortRequest` to `cancelRequest`.

Reviewed By: nicklockwood

Differential Revision: D2671189

fb-gh-sync-id: 6987d004e5a54973c330e19a1baba19ee41170f0
2015-11-18 15:48:29 -08:00

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;