Options
All
  • Public
  • Public/Protected
  • All
Menu

Module function/composeP

Index

References

Functions

References

Renames and re-exports composeP

Functions

  • composeP(...chain: ((...args: any[]) => Promise<any>)[]): any
  • Performs right-to-left composition of Promise-returning functions. The rightmost function may have any arity; the remaining functions must be unary.

    Note: ALL of the chained functions must return a Promise.

    Note: The result of compose is not automatically curried.

    example
     var res = x => Promise.resolve(x);
    var f = composeP(x => res(-x), (x, y) => res(Math.pow(x, y)));
    f(3, 4).then(console.log); // -(3^4)

    Parameters

    • Rest ...chain: ((...args: any[]) => Promise<any>)[]

    Returns any

Generated using TypeDoc