import { cf } from "https://deno.land/x/domain_functions@v2.6.0/mod.ts";
const { pipe } = cf;
Creates a single function out of a chain of multiple Composables. It will pass the output of a function as the next function's input in left-to-right order. The resulting data will be the output of the rightmost function.
Examples
import { cf as C } from 'domain-functions'
import { cf as C } from 'domain-functions'
const a = C.composable( ({ aNumber }: { aNumber: number }) => ({ aString: String(aNumber) }), ) const b = C.composable( ({ aString }: { aString: string }) => ({ aBoolean: aString == '1' }), ) const d = C.pipe(a, b) // ^? Composable<({ aNumber }: { aNumber: number }) => { aBoolean: boolean }>
Type Parameters
T extends [Composable, ...Composable[]]