Skip to main content
Module

x/domain_functions/mod.ts>cf.pipe

Decouple your business logic from your framework. With first-class type inference from end to end.
Latest
function cf.pipe
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'

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 }>

Parameters

...fns: T & PipeArguments<T>