Skip to content

Type Alias: EventEmitter<P, T, F>

ts
type EventEmitter<P, T, F> = (type: T, payload?: P, from?: F) => void;

Defined in: src/wirestate-react/types/events.ts:20

Represents the function returned by useEventEmitter.

Type Parameters

Type ParameterDefault typeDescription
PunknownThe type of the event payload.
T extends EventTypeEventTypeThe event identifier type.
FunknownThe type of the event source identifier.

Parameters

ParameterTypeDescription
typeTThe event identifier.
payload?POptional data associated with the event.
from?FOptional identifier of the event source.

Returns

void

Remarks

Typically returned by useEventEmitter. Supports optional payload and source identifier.