Skip to content

Commit 5923284

Browse files
committed
Removed all the requiring cycles by changing all to use directly the NativeModules
1 parent dcbde6f commit 5923284

File tree

4 files changed

+7
-6
lines changed

4 files changed

+7
-6
lines changed

README.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,6 @@
33

44
A project committed to making file access and data transfer easier and more efficient for React Native developers.
55

6-
# ⚠️ Unmaintained ⚠️
7-
86
# Version Compatibility Warning
97

108
rn-fetch-blob version 0.10.16 is only compatible with react native 0.60 and up. It should have been a major version bump, we apologize for the mistake. If you are not yet upgraded to react native 0.60 or above, you should remain on rn-fetch-blob version 0.10.15

polyfill/Blob.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,13 @@
22
// Use of this source code is governed by a MIT-style license that can be
33
// found in the LICENSE file.
44

5-
import RNFetchBlob from '../index.js'
5+
import {NativeModules} from 'react-native';
66
import fs from '../fs.js'
77
import getUUID from '../utils/uuid'
88
import Log from '../utils/log.js'
99
import EventTarget from './EventTarget'
1010

11+
const RNFetchBlob = NativeModules.RNFetchBlob
1112
const log = new Log('Blob')
1213
const blobCacheDir = fs.dirs.DocumentDir + '/RNFetchBlob-blobs/'
1314

@@ -291,7 +292,7 @@ export default class Blob extends EventTarget {
291292
if(!this._isReference) {
292293
return fs.unlink(this._ref).catch((err) => {
293294
console.warn(err)
294-
})
295+
})
295296
}
296297
else {
297298
return Promise.resolve()

polyfill/Fetch.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
1-
import RNFetchBlob from '../index.js'
1+
import {NativeModules} from 'react-native';
22
import Log from '../utils/log.js'
33
import fs from '../fs'
44
import unicode from '../utils/unicode'
55
import Blob from './Blob'
66

7+
const RNFetchBlob = NativeModules.RNFetchBlob
78
const log = new Log('FetchPolyfill')
89

910
log.disable()

polyfill/XMLHttpRequest.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,14 @@
22
// Use of this source code is governed by a MIT-style license that can be
33
// found in the LICENSE file.
44

5-
import RNFetchBlob from '../index.js'
5+
import {NativeModules} from 'react-native';
66
import XMLHttpRequestEventTarget from './XMLHttpRequestEventTarget.js'
77
import Log from '../utils/log.js'
88
import Blob from './Blob.js'
99
import ProgressEvent from './ProgressEvent.js'
1010
import URIUtil from '../utils/uri'
1111

12+
const RNFetchBlob = NativeModules.RNFetchBlob
1213
const log = new Log('XMLHttpRequest')
1314

1415
log.disable()

0 commit comments

Comments
 (0)