apr-seq

3.0.3 • Public • Published

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

Examples

import seq from 'apr-seq';
 
const then = (v) => new Promise((resolve) => resolve(v));
 
const seq = seq(
  async (v) => await then(+ 1),
  async (v) => await then(+ 2),
  async (v) => await then(+ 3)
);
 
const output = await seq(1); // 7

Returns Function

Package Sidebar

Install

npm i apr-seq

Weekly Downloads

1

Version

3.0.3

License

MIT

Last publish

Collaborators

  • ramitos