Skip to main content
Module

x/domain_functions/mod.ts>all

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

Creates a single domain function out of multiple domain functions. It will pass the same input and environment to each provided function. The functions will run in parallel. If all constituent functions are successful, The data field will be a tuple containing each function's output.

Examples

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

const a = mdf(z.object({ id: z.number() }))(({ id }) => String(id)) const b = mdf(z.object({ id: z.number() }))(({ id }) => id + 1) const c = mdf(z.object({ id: z.number() }))(({ id }) => Boolean(id)) const df = all(a, b, c) // ^? DomainFunction<[string, number, boolean]>