Skip to main content
Using Deno in production at your company? Earn free Deno merch.
Give us feedback
Module

x/domain_functions/src/constructor.ts

Types and functions to make composition easy and safe
Latest
import * as domainFunctions from "https://deno.land/x/domain_functions@v3.0.0/src/constructor.ts";

Functions

A functions that helps incremental migration from the legacy domain-functions library to the composable-functions. Both libraries can be installed simultaneously, but to mix and match functions in compositions using toComposable and fromComposable are necessary to ensure the error types are compatible. It will convert any Composable<(input?: unknown, environment?: unknown) => T> into a DomainFunction

Creates a domain function. After giving the input and environment schemas, you can pass a handler function that takes type safe input and environment. That function is gonna catch any errors and always return a Result.

Creates a domain function. After giving the input and environment schemas, you can pass a handler function that takes type safe input and environment. That function is gonna catch any errors and always return a Result.

A functions that turns the result of its callback into a Result object.

A functions that helps incremental migration from the legacy domain-functions library to the composable-functions. Both libraries can be installed simultaneously, but to mix and match functions in compositions using toComposable and fromComposable are necessary to ensure the error types are compatible. It will convert any DomainFunction into a Composable<(input?: unknown, environment?: unknown) => T>