Skip to main content
Module

x/domain_functions/src/index.ts>cf.collect

Decouple your business logic from your framework. With first-class type inference from end to end.
Go to Latest
function cf.collect
import { cf } from "https://deno.land/x/domain_functions@v2.6.0/src/index.ts";
const { collect } = cf;

Receives a Record of Composables, runs them all in parallel and preserves the shape of this record for the data property in successful results.

Examples

import { cf as C } from 'domain-functions'

const a = C.composable(() => '1') const b = C.composable(() => 2) const df = collect({ a, b }) // ^? Composable<() => { a: string, b: number }>

Type Parameters

T extends Record<string, Composable>

Parameters

fns: T & CollectArguments<T>