Home > post-me > Emitter > once
Add a listener to a specific event, that will only be invoked once
Signature:
once<K extends keyof E>(eventName: K): Promise<E[K]>;
Parameter | Type | Description |
---|---|---|
eventName | K | The name of the event |
Returns:
Promise<E[K]>
After the first occurrence of the specified event, the listener will be invoked and immediately removed.