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
This commit is contained in:
Kevin Gozali 2015-11-18 15:43:05 -08:00 committed by facebook-github-bot-4
parent 6dca903a73
commit 18cd0953c2
1 changed files with 18 additions and 1 deletions

View File

@ -10,4 +10,21 @@
*/
'use strict';
module.exports = require('NativeModules').Networking;
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;