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 Parameter | Default type | Description |
|---|---|---|
P | unknown | The type of the event payload. |
T extends EventType | EventType | The event identifier type. |
F | unknown | The type of the event source identifier. |
Parameters
| Parameter | Type | Description |
|---|---|---|
type | T | The event identifier. |
payload? | P | Optional data associated with the event. |
from? | F | Optional identifier of the event source. |
Returns
void
Remarks
Typically returned by useEventEmitter. Supports optional payload and source identifier.