sequential-resolve
v2.0.1
Published
Promise.all, but in series
Downloads
7
Maintainers
Readme
sequential-resolve
It's like Promise.all
but in series.
usage
const sequence = require(`sequential-resolve`)
const tasks = [
`ambitioner`,
() => `och`,
() => new Promise(resolve => setTimeout(resolve.bind(null, `regn`), 1000))
]
sequence(tasks)
.then(console.log)
.catch(console.log.bind(null, `error:`))
// [ `ambitioner`, `och`, `regn`]
api
sequence(operations[, options])
Returns a Promise.
operations
<Array>, collection of tasksoptions
<Object>, available options:{ resolveEagerly: false // Default }
resolveEagerly
<Boolean>, resolve as soon as possible, skipping all remaining operations.