Skip to main content
Module

x/froebel/mod.ts>applyPipe

A strictly typed utility library.
Go to Latest
variable applyPipe
import { applyPipe } from "https://deno.land/x/froebel@v0.22.0/mod.ts";

Like pipe but takes an argument as its first parameter and invokes the pipe with it.

Note: unlike in pipe, the first function of the pipe must take exactly one argument.

Examples

Example 1

applyPipe(2, double, square, half)  // -> 8

type

<T extends [λ<[any], any>, ...λ[]]>(arg: Parameters<T[0]>[0], ...funs: PipeReturn<T> extends never ? never : T) => PipeReturn<T>