Promise.all에
배열로 넣어 주면 되고
결과는 spread()로 받아주면 되는 듯?
var promise1 = Promise.resolve(3); var promise2 = 42; var promise3 = new Promise(function(resolve, reject) { setTimeout(resolve, 100, 'foo'); }); Promise.all([promise1, promise2, promise3]).then(function(values) { console.log(values); }); |
[링크 : https://developer.mozilla.org/ko/docs/Web/JavaScript/Reference/Global_Objects/Promise/all]
Concurrency Helper functions for dealing with concurrent requests. axios.all(iterable) axios.spread(callback) |
[링크 : https://www.npmjs.com/package/axios]
[링크 : https://lovemewithoutall.github.io/it/axios-multiple-request/]
[링크 : https://kapeli.com/cheat_sheets/Axios.docset/Contents/Resources/Documents/index]
'Programming > node.js' 카테고리의 다른 글
node expres jwt (0) | 2018.11.08 |
---|---|
npm 특정 버전의 모듈 설치하기 (0) | 2018.11.07 |
node.js REST get/post 관련 (0) | 2018.11.06 |
curl jwt (0) | 2018.10.26 |
node-rtsp-stream 과 node-rtsp-stream-es6 차이 (0) | 2018.10.24 |