mirror of
https://github.com/zhigang1992/react-native.git
synced 2026-04-29 04:35:36 +08:00
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:
committed by
facebook-github-bot-4
parent
6dca903a73
commit
18cd0953c2
@@ -10,4 +10,21 @@
|
|||||||
*/
|
*/
|
||||||
'use strict';
|
'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;
|
||||||
|
|||||||
Reference in New Issue
Block a user