apr-seq
v3.0.3
Published
Version of the compose function that is more natural to read. Each function consumes the return value of the previous function. It is the equivalent of compose with the arguments reversed.
Downloads
18
Maintainers
Readme
seq
Version of the compose function that is more natural to read. Each function consumes the return value of the previous function. It is the equivalent of compose with the arguments reversed.
Parameters
tasks
...Function
Examples
import seq from 'apr-seq';
const then = (v) => new Promise((resolve) => resolve(v));
const seq = seq(
async (v) => await then(v + 1),
async (v) => await then(v + 2),
async (v) => await then(v + 3)
);
const output = await seq(1); // 7
Returns Function