updated docs...

Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
This commit is contained in:
Alex A. Naanou 2022-10-31 02:25:16 +03:00
parent 0dc685f436
commit e82fcb5164

View File

@ -2903,6 +2903,21 @@ from being called.
-> undefined
```
Note that for `async` event `<func>(..)` it might be useful to trigger
the handlers after the promise resolves, this can be done by first calling
`<handle-func>(false)` to prevent the handlers from being triggered as soon
as the promise is returned and after an appropriate `await`ing calling
`<handle-func>()` to actually trigger the handlers.
Example:
```javascript
var evt = event.Event('evt', async function(handler, ...args){
handler(false)
var value = await something()
handler()
return value })
```
**Special case: `<event-commands>`**