In my sensortools I override the .on and .removeListener methods, but that is only for debugging purposes. I suspect too much overhead to do that in possibly multiple libs.
Maybe a fast low level function to get all listeners for specific event and a small module in js to handle storing/restoring them would work and be flexible enough.
Espruino is a JavaScript interpreter for low-power Microcontrollers. This site is both a support community for Espruino and a place to share what you are working on.
In my sensortools I override the .on and .removeListener methods, but that is only for debugging purposes. I suspect too much overhead to do that in possibly multiple libs.
Maybe a fast low level function to get all listeners for specific event and a small module in js to handle storing/restoring them would work and be flexible enough.