There are some examples. I recommend that you download/clone the BangleApps repo, https://github.com/espruino/BangleApps. And use a decent IDE/text editor that can search through all the projects in there.
I searched for keyword "emit" and found an example.
From briefly looking at the examples, its enough to call
var myobj = new Object();
The "Object" class is a compatible EventEmitter by default.
© Espruino, powered by microcosm.
Report a problem