function pipe
Allows to pipe results of functions into each other
Examples
🔗
▶
Example 1
Example 1
import { pipe } from "./composition.ts";
import { assertEquals } from "std/assert/mod.ts";
const add = (a: number) => (b: number) => a + b;
const multiply = (a: number) => (b: number) => a * b;
const result = pipe(
add(1),
multiply(2),
)(3);
assertEquals(result, 8);
Parameters
Parameters
Parameters
Parameters
Parameters
Parameters