From 9d7923f6b0f63b3451c42ace64c8628428c50eb0 Mon Sep 17 00:00:00 2001 From: Alberto Rocha Date: Fri, 27 Dec 2019 22:15:08 -0300 Subject: [PATCH] Fix require cycle warnings --- polyfill/Blob.js | 3 ++- polyfill/Fetch.js | 3 ++- polyfill/XMLHttpRequest.js | 3 ++- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/polyfill/Blob.js b/polyfill/Blob.js index 53662a798..e4d5217a4 100644 --- a/polyfill/Blob.js +++ b/polyfill/Blob.js @@ -2,11 +2,12 @@ // Use of this source code is governed by a MIT-style license that can be // found in the LICENSE file. -import RNFetchBlob from '../index.js' import fs from '../fs.js' import getUUID from '../utils/uuid' import Log from '../utils/log.js' import EventTarget from './EventTarget' +import {NativeModules} from 'react-native' +const RNFetchBlob = NativeModules.RNFetchBlob const log = new Log('Blob') const blobCacheDir = fs.dirs.DocumentDir + '/RNFetchBlob-blobs/' diff --git a/polyfill/Fetch.js b/polyfill/Fetch.js index 3ecb5915c..0667f9bd0 100644 --- a/polyfill/Fetch.js +++ b/polyfill/Fetch.js @@ -1,8 +1,9 @@ -import RNFetchBlob from '../index.js' import Log from '../utils/log.js' import fs from '../fs' import unicode from '../utils/unicode' import Blob from './Blob' +import {NativeModules} from 'react-native' +const RNFetchBlob = NativeModules.RNFetchBlob const log = new Log('FetchPolyfill') diff --git a/polyfill/XMLHttpRequest.js b/polyfill/XMLHttpRequest.js index 9036b2bc8..b5eb6674f 100644 --- a/polyfill/XMLHttpRequest.js +++ b/polyfill/XMLHttpRequest.js @@ -2,12 +2,13 @@ // Use of this source code is governed by a MIT-style license that can be // found in the LICENSE file. -import RNFetchBlob from '../index.js' import XMLHttpRequestEventTarget from './XMLHttpRequestEventTarget.js' import Log from '../utils/log.js' import Blob from './Blob.js' import ProgressEvent from './ProgressEvent.js' import URIUtil from '../utils/uri' +import {NativeModules} from 'react-native' +const RNFetchBlob = NativeModules.RNFetchBlob const log = new Log('XMLHttpRequest')