benjreinhart / react-native-aws3

Pure JavaScript React Native library for uploading to AWS S3
MIT License
399 stars 151 forks source link

Added abort method + fix for last pull #21

Closed markudevelop closed 7 years ago

benjreinhart commented 7 years ago

Code changes look good, but the readme should not list out the methods of the returned promise-like object as if they were methods that are part of the exported module like put.

How about something like:

Returns an object that wraps an `XMLHttpRequest` instance and behaves like a promise, with the following additional methods:

* `progress` - accepts a callback which will be called with an event representing the progress of the upload
* `abort` - aborts the xhr instance

Examples:

RNS3.put(file, options)
  .progress((e) => console.log(e.loaded / e.total));

RNS3.put(file, option)
  .abort();
markudevelop commented 7 years ago

@benjreinhart I just wanted to improve it a bit, this is even better! :+1: