openmixer — generated API reference
    Preparing search index...

    Interface LifecycleDoors<A>

    The lifecycle doors a row declares. Both are optional and independent: a send is removable but not creatable (its address is the pair, which always exists); a scene library is both.

    interface LifecycleDoors<A> {
        create?: (
            addr: A,
            delta: WireDelta,
        ) => CreateOutcome | Promise<CreateOutcome>;
        remove?: (addr: A) => RemoveOutcome | Promise<RemoveOutcome>;
        ripples?: (addr: A) => readonly RippleTarget[];
    }

    Type Parameters

    • A
    Index
    create?: (addr: A, delta: WireDelta) => CreateOutcome | Promise<CreateOutcome>

    Create an item under the collection this address names, from the request body. The row narrows every value through codecs exactly as a patch does, and answers the minted id.

    remove?: (addr: A) => RemoveOutcome | Promise<RemoveOutcome>

    Remove the item this address names. The row drives its ONE store — the same store its fields read — and answers what actually happened.

    ripples?: (addr: A) => readonly RippleTarget[]

    The instances whose state a create/remove at this address changed BESIDE it — a scene's deletion changes /scenes, a mute group's deletion changes its ex-members' composed mute. Declared here, EXECUTED by the registry, exactly as RippleTarget is for a patch.

    For a REMOVE the registry NAMES the targets before the door runs and re-projects them after: a removal's consequences are defined by what the item still was, and a deleted mute group asked afterwards who its members were would answer the empty set. For a CREATE the address is the collection, which exists on both sides, so it is read once after.