Domain.InMemory reference
InMemory
Section titled “InMemory”Source:
packages/domain/src/InMemory.tsKind: 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.
InMemory: Hosting in memory
Section titled “InMemory: Hosting in memory”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));