s
s
snc
Search…
⌃K

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.
snc.all([3,2,1], (element, index, done) => {
setTimeout(() => {
console.log(element)
done(element)
}, element * 1000)
},
res => {
console.log(`Reponse: ${JSON.stringify(res)}`)
})
-> 1
-> 2
-> 3
-> [3,2,1]
Last modified 2yr ago