From 18cd0953c2aab64f3f22c1a4449ff5ef7fa140ab Mon Sep 17 00:00:00 2001 From: Kevin Gozali Date: Wed, 18 Nov 2015 15:43:05 -0800 Subject: [PATCH] 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 --- Libraries/Network/RCTNetworking.ios.js | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/Libraries/Network/RCTNetworking.ios.js b/Libraries/Network/RCTNetworking.ios.js index 75e85b4fd..677f2c1c9 100644 --- a/Libraries/Network/RCTNetworking.ios.js +++ b/Libraries/Network/RCTNetworking.ios.js @@ -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;