Interface ICallback<Types, Ctx>

A registered callback entry stored in Callbacks.list.

interface ICallback<Types, Ctx> {
    action: TCallbacksAction<Types[keyof Types], Ctx>;
    id: string;
    name?: string;
    once?: boolean;
    protected?: boolean;
    target: keyof Types;
    timeout?: number;
}

Type Parameters

  • Types

    Event map.

  • Ctx

    Context type passed to the listener.

Hierarchy (View Summary)

Properties

action: TCallbacksAction<Types[keyof Types], Ctx>

Listener function executed on Callbacks.emit.

id: string

Unique callback identifier.

name?: string

Optional label for debugging.

once?: boolean

When true, the callback is removed automatically after the first execution.

false
protected?: boolean

When true, the callback cannot be removed via Callbacks.remove unless it is cleared internally (for example on Callbacks.destroy).

false
target: keyof Types

Event name this listener is bound to.

timeout?: number

Delay before the callback runs, in milliseconds.

undefined