Store54
Constructors
contractconstDeclare store shapes and optional custom methods.extendconstExtend an existing contract with more shapes, more custom methods, or both — the composable counterpart to contract (which builds one from scratch).registerconstRegister a scope on an aggregate Service without creating a standalone class.scopedconstStandalone store for one scope — class with layerMemory / layer({ filename? }) like Service, but single-scope.ServiceconstDeclare an app store — class extends with layerMemory / layer.shapefunctionDeclare a row shape.TagconstLike Service without layers — registration descriptor for remote clients.Spec Fields
Layers & Serving
Models
ContracttypeA pipeable store contract — shapes plus optional custom methods.HandleOftypeHandle inferred from a store contract.KeysOftypeScope keys (tuple registrations) or accessor keys (object registrations) on a store class.ServiceClasstypeAggregate store class produced by Service.StandalonetypeStandalone single-scope store class from scoped.StorageclassScope bridge every store handle resolves through — provided by an app Service layer or the soft-default layerDefaultMemory (via withDefaultStorage).StorageApiinterfaceScope bridge API carried by StorageStore.Storage.StorenamespaceStoreChangeEventclassEmitted on each append when Store.changes is subscribed.StoreEffectsOftypeThe object of effects produced by effects: the HandleOf structure (nested shape tree + custom methods) with Storage added to every method's requirement channel, carrying the StoreEffectsVariance brand.StoreEffectsVarianceinterfaceVariance carrier for the effects brand — mirrors Effect's Stream.Variance.StoreProvidedContexttypeRemove the requirement channel Ctx from every method in a resolved-effects shape, recursing into nested sub-trees — the per-method-precise result of provideContext.TagClasstypeRegistration-only aggregate (no layers) — browser-safe descriptor / remote client base.TypeIdtypeBrand identifier for an effects object — Effect's v4 TypeId shape (a string-literal id, present at runtime).Guards
Getters
Combinators
catchWriteErrorsconstNarrow StoreWriteError out of the error channel of a effects object's write methods — a fire-and-forget append that fails a journal/IO write is logged and swallowed (succeeds as void).effectsconstBuild a PURE object of effects from a contract — the HandleOf structure (nested shape tree + custom methods) where each method is (...args) => resolveOrDie(scope, contract).flatMap((handle) => handle.<path>(...args)).mapEffectsconstThe generic transform primitive: walk every method on a effects object (nested shape leaves + custom methods) and pass each method's returned Effect through transform, then re-nest and re-stamp the TypeId brand.provideContextconstProvide a Context.Context to every method of an effects object — the one-liner that replaces a repetitive per-method Effect.provideContext(...) wrapping.Logging
logLevelconstlogLevelAllconstlogLevelAllDefaultconstlogLevelDebugconstlogLevelDebugDefaultconstlogLevelErrorconstlogLevelErrorDefaultconstlogLevelInfoconstlogLevelInfoDefaultconstlogLevelNoneconstlogLevelNoneDefaultconstlogLevelWarnconstlogLevelWarnDefaultconststreamLevelAllconstPer-registration live stream floor for Hyperlink.logs (distinct from durable logLevel).streamLevelDebugconststreamLevelErrorconststreamLevelInfoconststreamLevelNoneconststreamLevelWarnconstwithDefaultLogLevelconstApply a store-wide default durable log export level (registration pipe overrides still win).