Skip to content

feat: on multiple events accept array#163

Open
legau wants to merge 1 commit intoyoannmoinet:masterfrom
legau:typescript-on-fix
Open

feat: on multiple events accept array#163
legau wants to merge 1 commit intoyoannmoinet:masterfrom
legau:typescript-on-fix

Conversation

@legau
Copy link
Copy Markdown

@legau legau commented Jun 20, 2021

Hi,

The type definition for Joystick.on and JoystickManager.on accepts arrays of events or only one event as a string. However this is not the case for the real on function which accepts only strings. So it's not possible to use multiple events correctly in TypeScript. This PR adds support for arrays of events.

@yoannmoinet
Copy link
Copy Markdown
Owner

Why not simply fix the type instead?
I think the mistake is with the type, not the implementation as the documentation is also referring to only strings.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants