nipplejs
nipplejs copied to clipboard
feat: on multiple events accept array
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.
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.