In node/browser if I need to incorporate an event emitter I either use the native events module or third party. Typically I'd create a new class by extending the event emitter. Like so. https://nodejs.org/api/events.html
import EventEmitter from 'events'
class SomeClass extends EventEmitter {
constructor() {
}
}
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 node/browser if I need to incorporate an event emitter I either use the native events module or third party. Typically I'd create a new class by extending the event emitter. Like so. https://nodejs.org/api/events.html
but it seems that all (plain?) objects in Espruino have an event emitter baked in by default. https://www.espruino.com/Reference#l_Object_emit
So when I make a new class or make an object like so I get an event emitter as well?
Is the actual event emitter module available? If so where is that in the api docs