s
s
snc
Search…
all
snc.all(array, callback_in_parallel(element, done), callback_end(data))
Execute all elements in array in parallel. And get all responses in order.
Alternative name: map.
1
snc.all([3,2,1], (element, index, done) => {
2
setTimeout(() => {
3
console.log(element)
4
done(element)
5
}, element * 1000)
6
},
7
res => {
8
console.log(`Reponse: ${JSON.stringify(res)}`)
9
})
Copied!
1
-> 1
2
-> 2
3
-> 3
4
-> [3,2,1]
Copied!
Last modified 1yr ago
Copy link