Skip to content

Commit

Permalink
Remove axios.all() and axios.spread() from Readme.md (#2727)
Browse files Browse the repository at this point in the history
* Updating Readme.md
- remove axios.all(), axios.spread()

* Updating Readme.md
- replace example
- axios.all() -> Promise.all()
- axios.spread(function (acct, perms)) -> function (acct, perms)
- add deprecated mark

* Update README.md

Make changes after review

Co-authored-by: Jay <jasonsaayman@gmail.com>
  • Loading branch information
ohtaeg and jasonsaayman committed May 27, 2020
1 parent 6d36dbe commit d35b5b5
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions README.md
Expand Up @@ -148,10 +148,11 @@ function getUserPermissions() {
return axios.get('/user/12345/permissions');
}

axios.all([getUserAccount(), getUserPermissions()])
.then(axios.spread(function (acct, perms) {
// Both requests are now complete
}));
Promise.all([getUserAccount(), getUserPermissions()])
.then(function (results) {
const acct = results[0];
const perm = results[1];
});
```

## axios API
Expand Down Expand Up @@ -207,12 +208,13 @@ For convenience aliases have been provided for all supported request methods.
###### NOTE
When using the alias methods `url`, `method`, and `data` properties don't need to be specified in config.

### Concurrency
### Concurrency (Deprecated)
Please use `Promise.all` to replace the below functions.

Helper functions for dealing with concurrent requests.

##### axios.all(iterable)
##### axios.spread(callback)
axios.all(iterable)
axios.spread(callback)

### Creating an instance

Expand Down

0 comments on commit d35b5b5

Please sign in to comment.