Skip to content
Interfacecorev0.12.0

EffectGate

A gate whose check method can refuse a request without applying its side effect. commit applies the effect after every gate passes. Cooldown is the catalog gate that returns one. Build one with defineEffectGate.

See also:defineEffectGate

interface EffectGate<
    Ctx extends GateContextBase = GateContextBase,
    Name extends string = string
> extends Gate<Ctx, Name>

Properties

Methods

Name

The literal name a mismatch error prints.

Name extends string = string

name

The gate's name, surfaced in a mismatch error and joined by the combinators.

readonly name: Name

Inherited from:Gate

check()

Reads the context and refuses by throwing a Notice or a Silence, or passes by resolving.

check(ctx: Ctx): Promise<void>

Inherited from:Gate

commit()

Applies the side effect, run only after the whole gate set passes.

commit(ctx: Ctx): Promise<void>