News for hackers. Stuff that matters.
Re:Side Effects vs. Promises by k__ on Sunday October 04, 2015 @01:52PM (#10328186)
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.

Re:Side Effects vs. Promises by inglor on Sunday October 04, 2015 @01:55PM (#10328192)
For this there are Observables and async iterators. I warmly recommend 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 and https://github.com/Reactive-Extensions/RxJS