Skip to content

Domain.InMemory reference

Source: packages/domain/src/InMemory.ts Kind: Layer · Provides: Domain.Platform, WorkflowEngine

Host a domain model in the current process: aggregates, views and policies, with nothing to deploy. Use it in tests and single-process apps; swap it for DomainCloudflare.DurableObjects and nothing else changes.

import * as Domain from "@alchemy.run/domain";
import * as Layer from "effect/Layer";
import { Bank, BankPolicies } from "./Bank.ts";
export const BankInMemory = Bank.layer(BankPolicies).pipe(Layer.provide(Domain.InMemory));