is event emitter baked in to all objects? #7622
Unanswered
espruino-discuss
asked this question in
Other Board General Questions
Replies: 1 comment
-
Posted at 2020-09-04 by @gfwilliams Yes, that's right. There's no explicit |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Posted at 2020-09-03 by dgk
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
Beta Was this translation helpful? Give feedback.
All reactions