post-me

Home > post-me > Emitter > once

Emitter.once() method

Add a listener to a specific event, that will only be invoked once

Signature:

once<K extends keyof E>(eventName: K): Promise<E[K]>;

Parameters

Parameter Type Description
eventName K The name of the event

Returns:

Promise<E[K]>

Remarks

After the first occurrence of the specified event, the listener will be invoked and immediately removed.