Skip to main content
Module

x/domain_functions/mod.ts>collect

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

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

Examples

import { mdf, collect } from 'domain-functions'

const a = mdf(z.object({}))(() => '1') const b = mdf(z.object({}))(() => 2) const df = collect({ a, b }) // ^? DomainFunction<{ a: string, b: number }>

Type Parameters

Fns extends Record<string, DomainFunction>