Skip to content

2.0.0

Compare
Choose a tag to compare
@niklasramo niklasramo released this 12 May 22:02
· 39 commits to main since this release

Updates

  • Slightly improved performance in some scenarios -> replaced for of loops with forEach.
  • New method: .listenerCount( eventName ).
  • New protected method: ._getListeners( eventName ).
    • This method does everything what .emit() does except the actual emitting. It caches (and returns) the listeners and clears once listeners. It's extremely useful for scenarios where you want to emit multiple events simultaneously in a batch.
  • Improved tests.

Breaking changes

  • Removed submodules (eventti/emitter and eventti/unique-emitter) for now as they were not working nicely with TypeScript and because you can easily tree-shake the other emitter if you are not using it.