Skip to content
ClassDebugger & Diagnostics@public

DebugChannel

Typed pub/sub channel that connects the game loop to optional debug consumers.

ts
export declare class DebugChannel

Methods

destroy()

ts
destroy(): void

Removes all listeners.

Returns: void

emit()

ts
emit<T extends DebugEventType>(type: T, payload: DebugEvents[T]): void

Parameters:

ParameterTypeDescription
typeT-
payloadDebugEvents[T]-

Returns: void

off()

ts
off<T extends DebugEventType>(type: T, handler: DebugHandler<T>): void

Parameters:

ParameterTypeDescription
typeT-
handlerDebugHandler<T>-

Returns: void

on()

ts
on<T extends DebugEventType>(type: T, handler: DebugHandler<T>): void

Parameters:

ParameterTypeDescription
typeT-
handlerDebugHandler<T>-

Returns: void

Released under the MIT License.