nipplejs icon indicating copy to clipboard operation
nipplejs copied to clipboard

feat: on multiple events accept array

Open legau opened this issue 4 years ago • 1 comments

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.

legau avatar Jun 20 '21 12:06 legau

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.

yoannmoinet avatar Jun 28 '22 14:06 yoannmoinet