FrontendInterviews.dev

Loading problem…

136. Advanced Event Emitter

Hard•
Acceptance: 85.71%
•
🔓3/3 Pro unlocks today

This problem builds on event-emitter-ii. Complete that first, then load your solution to continue.

Implement an advanced EventEmitter with async handlers, middleware, event batching, history, and wildcard listeners.

Requirements

1. Advanced Features

  • Async event handlers (support Promises)
  • Middleware support (pre/post handlers)
  • Event batching (batch multiple emits)
  • Event history (track emitted events)
  • Wildcard listeners (* or event:*)

Constraints

  • Support async handlers
  • Support middleware
  • Support event batching
  • Track event history
  • Support wildcard listeners