Skip to content

Fix for #183 #688

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Feb 23, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion polyfill/Blob.js
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Consider having module in polyfill/RNFetchBlob.js:

import { NativeModules } from 'react-native';

const RNFetchBlob = NativeModules.RNFetchBlob

export default RNFetchBlob;

Seems like trivial module but allows to have single shared source.

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/'

Expand Down
3 changes: 2 additions & 1 deletion polyfill/Fetch.js
Original file line number Diff line number Diff line change
@@ -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()
Expand Down
3 changes: 2 additions & 1 deletion polyfill/XMLHttpRequest.js
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down