-
• #2
Yes, that's right. There's no explicit
EventEmitter
class. At the moment it is in all objects by default - initially the performance cost of adding it to every object was less than having two different kinds of object. It's something I did plan on changing at some point but it's been low priority.
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