API reference
Every public class, method, and event in @codexo/exojs. Generated from source.
classSignal
Lightweight typed event emitter. Each `Signal` represents one named notification channel (e.g. `onResize`, `onFrame`). Listeners are added with Signal.add or Signal.once, removed with Signal.remove, and notified with Signal.dispatch. `Args` is the tuple of arguments passed to listeners — type-checked end to end so a `new Signal<[number, string]>()` enforces both `dispatch(1, 'x')` and the listener signature `(n: number, s: string) => …`. Handlers are stored as direct function references (no wrapper objects). `dispatch` uses a guard flag instead of a snapshot copy, so no allocation occurs per dispatch. Handlers added or removed during dispatch take effect on the next call; a `remove` mid-dispatch defers the splice until after the current iteration finishes. Returning `false` from a handler short-circuits the rest of the dispatch.
import { Signal } from '@codexo/exojs' Lightweight typed event emitter. Each `Signal` represents one named notification channel (e.g. `onResize`, `onFrame`). Listeners are added with Signal.add or Signal.once, removed with Signal.remove, and notified with Signal.dispatch.
`Args` is the tuple of arguments passed to listeners — type-checked end to end so a `new Signal\<[number, string]>()` enforces both `dispatch(1, 'x')` and the listener signature `(n: number, s: string) => …`.
Handlers are stored as direct function references (no wrapper objects). `dispatch` uses a guard flag instead of a snapshot copy, so no allocation occurs per dispatch. Handlers added or removed during dispatch take effect on the next call; a `remove` mid-dispatch defers the splice until after the current iteration finishes. Returning `false` from a handler short-circuits the rest of the dispatch.
new(): Signal<Args> add(handler: SignalHandler<Args>): this clear(): this destroy(): void dispatch(params: Args): this has(handler: SignalHandler<Args>): boolean once(handler: SignalHandler<Args>): this remove(handler: SignalHandler<Args>): this count: number