Type alias EventHandler<EmitterEvent, EventType>
EventHandler<EmitterEvent, EventType>: ((payload: Extract<EmitterEvent, {
type: EventType;
}>, ...args: any[]) => void)
Type declaration
-
- (payload: Extract<EmitterEvent, {
type: EventType;
}>, ...args: any[]): void
-
Parameters
-
payload: Extract<EmitterEvent, {
type: EventType;
}>
-
Rest
...args: any[]
Returns void
Handler for an event on an EventEmitter; selects the correct type for the event payload from the provided union based on the provided string literal type.