Or take it a step further:
I would consider migrating the whole library to typescript and adding the rxjs library.
With rxjs you will be able to subscribe to different changes such as position changes etc
Also you will be able to know which type of messages are emitted from different events and be able to thorttle messages and buffer them