compose
Composes functions right-to-left: compose(f, g)(x) is equivalent to f(g(x)).
The inverse of pipe, which applies functions left-to-right.
Available since v2.0.0
Import
Section titled “Import”Signature
Section titled “Signature”Parameters
Section titled “Parameters”| Parameter | Type | Description |
|---|---|---|
fn1 | function |
Returns
Section titled “Returns”function — A function that applies fns in reverse order
Examples
Section titled “Examples”Compose functions right-to-left
Section titled “Compose functions right-to-left”compose(f, g)(x) is equivalent to f(g(x)). The rightmost function is applied first.
Build a validator from small predicates
Section titled “Build a validator from small predicates”Compose small predicate functions into a single validator.
