News for hackers. Stuff that matters.
Re:Asynchronous JavaScript at Netflix by bicknergseng on Friday May 16, 2014 @01:15PM (#7756564)
Opinions on reactive vs promises?
Re:Asynchronous JavaScript at Netflix by alipang on Friday May 16, 2014 @01:23PM (#7756620)
Reactive (event) streams are a generalization of promises in a sense, from a single value to a stream of multiple ones. Both are monads.

Streams are to promises what lists are to maybes (options).

Re:Asynchronous JavaScript at Netflix by mattpodwysocki on Friday May 16, 2014 @05:16PM (#7757960)
Reactive is really good for events which could happen zero to infinite times. The composition model is great for that, because we treat these as collections that you can query just as you would query an Array in JavaScript.

Promises on the other hand, are more for scalar values and composition is rather limited based upon that. However, RxJS plays very well with Promises such as the following: https://gist.github.com/mattpodwysocki/b57cf50a34f22ba39e4f . This really shows where Promises leave off and true good composition starts.