Quellcode durchsuchen

bump to 0.10.0-beta.2

Ben Hsieh vor 8 Jahren
Ursprung
Commit
2b23235332
3 geänderte Dateien mit 28 neuen und 7 gelöschten Zeilen
  1. 24
    3
      src/README.md
  2. 2
    2
      src/package.json
  3. 2
    2
      src/react-native-fetch-blob.podspec

+ 24
- 3
src/README.md Datei anzeigen

@@ -1,11 +1,8 @@
1 1
 # react-native-fetch-blob
2 2
 [![release](https://img.shields.io/github/release/wkh237/react-native-fetch-blob.svg?style=flat-square)](https://github.com/wkh237/react-native-fetch-blob/releases) [![npm](https://img.shields.io/npm/v/react-native-fetch-blob.svg?style=flat-square)](https://www.npmjs.com/package/react-native-fetch-blob) ![](https://img.shields.io/badge/PR-Welcome-brightgreen.svg?style=flat-square) [![](https://img.shields.io/badge/Wiki-Public-brightgreen.svg?style=flat-square)](https://github.com/wkh237/react-native-fetch-blob/wiki) [![npm](https://img.shields.io/npm/l/react-native-fetch-blob.svg?maxAge=2592000&style=flat-square)]()
3 3
 
4
-
5 4
 A project committed to make file acess and data transfer easier, efficient for React Native developers.
6 5
 
7
-# [Please visit our Github Page for latest document](https://github.com/wkh237/react-native-fetch-blob)
8
-
9 6
 ## Features
10 7
 - Transfer data directly from/to storage without BASE64 bridging
11 8
 - File API supports normal files, Asset files, and CameraRoll files
@@ -403,6 +400,30 @@ In `version >= 0.4.2` it is possible to know the upload/download progress. After
403 400
     })
404 401
 ```
405 402
 
403
+In `0.9.6`, you can specify an optional first argument which contains `count` and `interval` to limit progress event frequency (this will be done in native context in order to reduce RCT bridge overhead). Notice that `count` argument will not work if the server does not provide response content length.
404
+
405
+
406
+```js
407
+  RNFetchBlob.fetch('POST', 'http://www.example.com/upload', {
408
+      ... some headers,
409
+      'Content-Type' : 'octet-stream'
410
+    }, base64DataString)
411
+    // listen to upload progress event, emit every 250ms
412
+    .uploadProgress({ interval : 250 },(written, total) => {
413
+        console.log('uploaded', written / total)
414
+    })
415
+    // listen to download progress event, every 10%
416
+    .progress({ count : 10 }, (received, total) => {
417
+        console.log('progress', received / total)
418
+    })
419
+    .then((resp) => {
420
+      // ...
421
+    })
422
+    .catch((err) => {
423
+      // ...
424
+    })
425
+```
426
+
406 427
 ### Cancel Request
407 428
 
408 429
 After `0.7.0` it is possible to cancel a HTTP request. When the request cancel, it will definately throws an promise rejection, be sure to catch it.

+ 2
- 2
src/package.json Datei anzeigen

@@ -1,6 +1,6 @@
1 1
 {
2 2
   "name": "react-native-fetch-blob",
3
-  "version": "0.10.0-beta.1",
3
+  "version": "0.10.0-beta.2",
4 4
   "description": "A module provides upload, download, and files access API. Supports file stream read/write for process large files.",
5 5
   "main": "index.js",
6 6
   "scripts": {
@@ -47,4 +47,4 @@
47 47
     "smartt <github@eriksmartt.com>",
48 48
     ""
49 49
   ]
50
-}
50
+}

+ 2
- 2
src/react-native-fetch-blob.podspec Datei anzeigen

@@ -1,12 +1,12 @@
1 1
 Pod::Spec.new do |s|
2 2
   s.name             = "react-native-fetch-blob"
3
-  s.version          = "0.10.0-beta.1"
3
+  s.version          = "0.10.0-beta.2"
4 4
   s.summary          = "A project committed to make file acess and data transfer easier, effiecient for React Native developers."
5 5
   s.requires_arc = true
6 6
   s.license      = 'MIT'
7 7
   s.homepage     = 'n/a'
8 8
   s.authors      = { "wkh237" => "xeiyan@gmail.com" }
9
-  s.source       = { :git => "https://github.com/wkh237/react-native-fetch-blob", :tag => 'v0.10.0-beta.1'}
9
+  s.source       = { :git => "https://github.com/wkh237/react-native-fetch-blob", :tag => 'v0.10.0-beta.2'}
10 10
   s.source_files = 'ios/**/*.{h,m}'
11 11
   s.platform     = :ios, "7.0"
12 12
   s.dependency 'React/Core'