You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
minor #1685 [Live] Add signature overload for on and off methods of component (YummYume)
This PR was squashed before being merged into the 2.x branch.
Discussion
----------
[Live] Add signature overload for on and off methods of component
| Q | A
| ------------- | ---
| Bug fix? |no
| New feature? | no
| Issues |
| License | MIT
Following some feedback in #1676. This PR only affects TypeScript typing.
Provides automatic typing for the `on` and `off` events of a component, depending on the event's name. Also changes the return type allowed from an event listener to allow passing an asynchronous function. This is a pretty common thing to do (the need to use `await`), but TypeScript/linters will often yell at you for doing so if the event listener does not expect a `Promise` to be returned.
(also fixed a typing issue with `NodeJS.Timer` being used instead of `number`)
Commits
-------
3c17279 [Live] Add signature overload for on and off methods of component
0 commit comments