Skip to content

Commit c5fe21a

Browse files
committed
docs: mention .emitAsPromise() advantage
1 parent ed7668a commit c5fe21a

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

README.md

+2
Original file line numberDiff line numberDiff line change
@@ -181,6 +181,8 @@ const values = await emitter.emitAsPromise('hello', 1)
181181
// [2, 3]
182182
```
183183

184+
> Unlike `.emit()`, the `.emitAsPromise()` method _awaits asynchronous listeners_.
185+
184186
### `.emitAsGenerator(type[, data])`
185187

186188
Emits the given event with optional data, and returns a generator function that exhausts all matching event listeners. Using a generator gives you granular control over what listeners are called.

0 commit comments

Comments
 (0)