gameplate - v2.2.0
    Preparing search index...

    Interface MachineConfig<S, E>

    interface MachineConfig<S extends string, E extends string> {
        initial: S;
        on: Transitions<S, E>;
        onEnter?: Readonly<Partial<Record<S, () => void>>>;
        onExit?: Readonly<Partial<Record<S, () => void>>>;
    }

    Type Parameters

    • S extends string
    • E extends string
    Index

    Properties

    initial: S

    State the machine starts in.

    Transition table: from → event → to. Unlisted transitions are ignored.

    onEnter?: Readonly<Partial<Record<S, () => void>>>

    Fires once when entering each listed state (including initial).

    onExit?: Readonly<Partial<Record<S, () => void>>>

    Fires once when leaving each listed state.