Skip to main content
Module

x/domain_functions/src/domain-functions.ts>merge

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

NOTE : Try to use collect instead wherever possible since it is much safer. merge can create domain functions that will always fail in run-time or even overwrite data from successful constituent functions application. The collect function does not have these issues and serves a similar purpose.

Examples

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

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

Type Parameters

Fns extends DomainFunction<Record<string, unknown>>[]