Skip to content
This repository was archived by the owner on Mar 16, 2019. It is now read-only.

Commit 206588f

Browse files
committed
Merge branch 'master' of github.com:wkh237/react-native-fetch-blob into 0.10.7
2 parents dd4dbb2 + d1d07d0 commit 206588f

File tree

2 files changed

+6
-5
lines changed

2 files changed

+6
-5
lines changed

README.md

+6-4
Original file line numberDiff line numberDiff line change
@@ -26,13 +26,13 @@ A project committed to making file access and data transfer easier and more effi
2626
* [Android Media Scanner, and Download Manager Support](#user-content-android-media-scanner-and-download-manager-support)
2727
* [Self-Signed SSL Server](#user-content-self-signed-ssl-server)
2828
* [Transfer Encoding](#user-content-transfer-encoding)
29-
* [RNFetchBlob as Fetch](#user-content-rnfetchblob-as-fetch)
29+
* [Drop-in Fetch Replacement](#user-content-drop-in-fetch-replacement)
3030
* [File System](#user-content-file-system)
3131
* [File access](#user-content-file-access)
3232
* [File stream](#user-content-file-stream)
3333
* [Manage cached files](#user-content-cache-file-management)
3434
* [Web API Polyfills](#user-content-web-api-polyfills)
35-
* [Performance Tips](#user-content-performance-tipsd)
35+
* [Performance Tips](#user-content-performance-tips)
3636
* [API References](https://github.com/wkh237/react-native-fetch-blob/wiki/Fetch-API)
3737
* [Caveats](#user-content-caveats)
3838
* [Development](#user-content-development)
@@ -452,11 +452,11 @@ task.cancel((err) => { ... })
452452

453453
```
454454

455-
### RNFetchBlob as Fetch
455+
### Drop-in Fetch Replacement
456456

457457
0.9.0
458458

459-
If you have existing code that uses `whatwg-fetch`(the official **fetch**), you don't have to change them after 0.9.0, just use fetch replacement. The difference between Official fetch and fetch replacement is, official fetch uses [whatwg-fetch](https://github.com/github/fetch) js library which wraps XMLHttpRequest polyfill under the hood it's a great library for web developers, however that does not play very well with RN. Our implementation is simply a wrapper of RNFetchBlob.fetch and fs APIs, so you can access all the features we provide.
459+
If you have existing code that uses `whatwg-fetch`(the official **fetch**), it's not necessary to replace them with `RNFetchblob.fetch`, you can simply use our **Fetch Replacement**. The difference between Official them is official fetch uses [whatwg-fetch](https://github.com/github/fetch) which wraps XMLHttpRequest polyfill under the hood. It's a great library for web developers, but does not play very well with RN. Our implementation is simply a wrapper of our `fetch` and `fs` APIs, so you can access all the features we provided.
460460

461461
[See document and examples](https://github.com/wkh237/react-native-fetch-blob/wiki/Fetch-API#fetch-replacement)
462462

@@ -613,6 +613,8 @@ In `v0.5.0` we've added `writeStream` and `readStream`, which allows your app r
613613

614614
When calling `readStream` method, you have to `open` the stream, and start to read data. When the file is large, consider using an appropriate `bufferSize` and `interval` to reduce the native event dispatching overhead (see [Performance Tips](#user-content-performance-tips))
615615

616+
> The file stream event has a default throttle(10ms) and buffer size which preventing it cause too much overhead to main thread, yo can also [tweak these values](#user-content-performance-tips).
617+
616618
```js
617619
let data = ''
618620
RNFetchBlob.fs.readStream(

android/src/main/java/com/RNFetchBlob/RNFetchBlobPackage.java

-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@ public List<NativeModule> createNativeModules(ReactApplicationContext reactConte
2020
return modules;
2121
}
2222

23-
@Override
2423
public List<Class<? extends JavaScriptModule>> createJSModules() {
2524
return Collections.emptyList();
2625
}

0 commit comments

Comments
 (0)