Skip to content

Commit

Permalink
feat(event-emitter): Enable invoking asynchronous handlers (#649)
Browse files Browse the repository at this point in the history
* Add new emitAsync method, memory leak prevention and significantly improve README.md

* Adjust ci yarn install command

* Commit yarn.lock

* Run changeset

* Revert ci yarn install command

* Move context parameter to the first position in the `emit` method

* Fix test
  • Loading branch information
DavidHavl authored Aug 6, 2024
1 parent d3e7037 commit 0b6d821
Show file tree
Hide file tree
Showing 6 changed files with 1,066 additions and 370 deletions.
12 changes: 12 additions & 0 deletions .changeset/tender-knives-compare.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
---
'@hono/event-emitter': major
---

### Added:
- New `emitAsync` method to the EventEmitter to enable invoking asynchronous handlers.
- Added prevention for potential memory leak when adding handlers inside of middleware via `on` method.
- Introduced new option of EventEmitter `maxHandlers` that limits number of handlers that can be added to a single event.
- Significantly improved documentation.

### Changed:
- Moved context parameter to the first position in the `emit` method.
Loading

0 comments on commit 0b6d821

Please sign in to comment.