Skip to main content
Module

x/denofun/compose.ts

Small utility library containing functions, monads and other fun stuff.
Latest
File
/** * **compose** takes a list of functions and does right-to-left function composition * @param fns a list of functions to compose * @returns a new function composed from the provided functions */export default function compose(...fns: any[]) { return fns.reduceRight((f, g) => (...args: any) => g(f(...args)));}