Skip to main content
Module

x/composium/util.ts>composeAsync

Powered by functional composition and the URL Pattern API, composium has become the most flexible routing framework in the world.
Go to Latest
function composeAsync
import { composeAsync } from "https://deno.land/x/composium@v0.0.1/util.ts";

Composes single-argument functions from right to left. The rightmost function can take multiple arguments as it provides the signature for the resulting composite function.

Returns

<R>(a: R) => R

A function obtained by composing the argument functions from right to left. For example, compose(f, g, h) is identical to doing (...args) => f(g(h(...args))).

Type Parameters

A
T extends any[]
R

Parameters

f1: (a: A) => R
f2: Func<T, A>

Returns

Func<T, R>

Type Parameters

A
B
T extends any[]
R

Parameters

f1: (b: B) => R
f2: (a: A) => B
f3: Func<T, A>

Returns

Func<T, R>

Type Parameters

A
B
C
T extends any[]
R

Parameters

f1: (c: C) => R
f2: (b: B) => C
f3: (a: A) => B
f4: Func<T, A>

Returns

Func<T, R>

Parameters

f1: (a: any) => R
...funcs: Function[]

Returns

(...args: any[]) => R

Parameters

...funcs: Function[]

Returns

(...args: any[]) => R