From ae41bff762c7fc8093002b6164e485a0b81829c4 Mon Sep 17 00:00:00 2001 From: Alex Naiman Date: Thu, 22 Oct 2020 23:33:56 +0300 Subject: [PATCH] fix: 183 requiring cycles --- 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..c99754dc2 100644 --- a/polyfill/Blob.js +++ b/polyfill/Blob.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 {NativeModules} from 'react-native'; import fs from '../fs.js' import getUUID from '../utils/uuid' import Log from '../utils/log.js' import EventTarget from './EventTarget' +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..8cc9f08e6 100644 --- a/polyfill/Fetch.js +++ b/polyfill/Fetch.js @@ -1,9 +1,10 @@ -import RNFetchBlob from '../index.js' +import {NativeModules} from 'react-native'; import Log from '../utils/log.js' import fs from '../fs' import unicode from '../utils/unicode' import Blob from './Blob' +const RNFetchBlob = NativeModules.RNFetchBlob const log = new Log('FetchPolyfill') log.disable() diff --git a/polyfill/XMLHttpRequest.js b/polyfill/XMLHttpRequest.js index 9036b2bc8..d52e47e19 100644 --- a/polyfill/XMLHttpRequest.js +++ b/polyfill/XMLHttpRequest.js @@ -2,13 +2,14 @@ // 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 {NativeModules} from 'react-native'; 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' +const RNFetchBlob = NativeModules.RNFetchBlob const log = new Log('XMLHttpRequest') log.disable()