3 ms·
I use promises most of the time. In frameworks like koa they even got a bit nicer. Is there something like this for event systems? I mean, if I send stuff to
by k__ 11y ago
I use promises most of the time. In frameworks like koa they even got a bit nicer.
Is there something like this for event systems?
I mean, if I send stuff to the server and wait for it to answer, promises work really well.
But what about things like onClick? The promise can only resolve once.
- inglor 11y agoFor this there are Observables and async iterators. I warmly recommend https://channel9.msdn.com/Events/Lang-NEXT/Lang-NEXT-2014/Keynote-Duality https://channel9.msdn.com/Events/Lang-NEXT/Lang-NEXT-2014/Ke... . I've also personally been using Rx and RxJS a lot and have been enjoying it a lot over the past few years. Observables and async iterators are both features that are on standards track for the language. See https://github.com/zenparsing/es-observable https://github.com/zenparsing/es-observable and https://github.com/Reactive-Extensions/RxJS https://github.com/Reactive-Extensions/RxJS