2
0
mirror of https://github.com/tenrok/axios.git synced 2026-06-02 16:04:10 +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:
Taegyeoung Oh
2020-05-28 02:43:08 +09:00
committed by GitHub
parent 6d36dbe7b7
commit d35b5b5902
+9 -7
View File
@@ -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
@@ -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