That sounds about right... There is some basic event emitter stuff - check the reference (however it applies to all objects right now, not via a special EventEmitter class).
However you might be best off using callbacks instead... Especially as there's no bind function yet. By the way, it uses regex too, and Espruino can't do that yet.
Personally I'd just look at what it's doing and reimplement it... That would probably be easier than trying to convert, and you'd probably get a nicer result
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.
That sounds about right... There is some basic event emitter stuff - check the reference (however it applies to all objects right now, not via a special EventEmitter class).
However you might be best off using callbacks instead... Especially as there's no
bind
function yet. By the way, it uses regex too, and Espruino can't do that yet.Personally I'd just look at what it's doing and reimplement it... That would probably be easier than trying to convert, and you'd probably get a nicer result