Runs the given task functions sequentially and collects their results.
Stops at the first rejection. If you want to keep going on errors, wrap each task in a tryCatch (from fp.ts) before passing it.
tryCatch
fp.ts
Return type preserves the tuple shape of the input so heterogeneous return types are inferred individually instead of being unified.
const [user, post] = await pSeries([ () => loadUser(1), // () => Promise<User> () => loadPost(2), // () => Promise<Post>])// user: User, post: Post Copy
const [user, post] = await pSeries([ () => loadUser(1), // () => Promise<User> () => loadPost(2), // () => Promise<Post>])// user: User, post: Post
Runs the given task functions sequentially and collects their results.
Stops at the first rejection. If you want to keep going on errors, wrap each task in a
tryCatch(fromfp.ts) before passing it.Return type preserves the tuple shape of the input so heterogeneous return types are inferred individually instead of being unified.