mirror of
https://github.com/tenrok/axios.git
synced 2026-06-20 20:00:40 +03:00
Remove axios.all() and axios.spread() from Readme.md (#2727)
* 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>
This commit is contained in:
@@ -148,10 +148,11 @@ function getUserPermissions() {
|
|||||||
return axios.get('/user/12345/permissions');
|
return axios.get('/user/12345/permissions');
|
||||||
}
|
}
|
||||||
|
|
||||||
axios.all([getUserAccount(), getUserPermissions()])
|
Promise.all([getUserAccount(), getUserPermissions()])
|
||||||
.then(axios.spread(function (acct, perms) {
|
.then(function (results) {
|
||||||
// Both requests are now complete
|
const acct = results[0];
|
||||||
}));
|
const perm = results[1];
|
||||||
|
});
|
||||||
```
|
```
|
||||||
|
|
||||||
## axios API
|
## axios API
|
||||||
@@ -207,12 +208,13 @@ For convenience aliases have been provided for all supported request methods.
|
|||||||
###### NOTE
|
###### NOTE
|
||||||
When using the alias methods `url`, `method`, and `data` properties don't need to be specified in config.
|
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.
|
Helper functions for dealing with concurrent requests.
|
||||||
|
|
||||||
##### axios.all(iterable)
|
axios.all(iterable)
|
||||||
##### axios.spread(callback)
|
axios.spread(callback)
|
||||||
|
|
||||||
### Creating an instance
|
### Creating an instance
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user