API reference

Every public class, method, and event in @codexo/exojs. Generated from source.

C

classSignal

@codexo/exojs / core / stable

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.

1
props
7
methods
0
events
Import
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.

Constructors 1
new(): Signal<Args>
Methods 7
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
Properties 1
count: number
Source