Gate
A precondition attached to a handler. It refuses by throwing a NoticeNotice (a reply) or a SilenceSilence (a quiet drop), and passes by returning. CtxCtx is the context it requires, so a gate that reads ctx.interactionctx.interaction is rejected on an event handler at compile time. NameName is captured as a literal so a mismatch error can name the gate. Build one with defineGatedefineGate or defineEffectGatedefineEffectGate.
The bound is GateContextBaseGateContextBase, not the GateContextGateContext union, because the base has no kindkind and so is not a union member. Binding to the union would collapse an identity gate's requirement to nevernever.
See also:defineGate
interface Gate<
Ctx extends GateContextBase = GateContext,
Name extends string = string
>interface Gate<
Ctx extends GateContextBase = GateContext,
Name extends string = string
>Properties
Methods
Ctx
The context the gate requires, so reading a field absent on a handler's context is a compile error.
Ctx extends GateContextBase = GateContextCtx extends GateContextBase = GateContextName
The gate's name captured as a literal, so a mismatch error can name the gate.