Implement an event emitter

0
Remix

Implement an event emitter class: on(event, handler), off(event, handler), once(event, handler) and emit(event, ...args). Handlers run in the order they were added. Handle a handler that removes itself or adds another handler during emit, and return a way to unsubscribe from on.

SnowflakeTechnical phone screenLast asked Jan 2026
No answer yet. Write the first one; the best answer gets endorsed.