* Execute an event function. * * @param event Event function to execute. * @returns A promise the resolves when the event function is done executing, * or rejects if it throws an error.
(event: EventFunction)
| 75 | * or rejects if it throws an error. |
| 76 | */ |
| 77 | async function executeEventFunction(event: EventFunction): Promise<void> { |
| 78 | if (typeof event === 'function') { await event(); } |
| 79 | else { await Promise.resolve(event); } |
| 80 | } |
| 81 | |
| 82 | /** |
| 83 | * Wrap an event function in another event that resolves a promise when done. |
no outgoing calls
no test coverage detected