Thanks - I'm afraid that would appear to be the best bet for now. I'll add that to the next firmware though.
In terms of removing listeners, you need to have a named function so you can remove it...
function magListener() {
console.log("mag received");
compassEventReceived = true;
}
Bangle.on('mag', magListener);
// Wait two seconds, that should be enough for each of the events to get raised once
setTimeout(() => {
Bangle.removeListener('mag', magListener);
}, 2000);
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.
Thanks - I'm afraid that would appear to be the best bet for now. I'll add that to the next firmware though.
In terms of removing listeners, you need to have a named function so you can remove it...