3 ms·
Opinions on reactive vs promises?
by bicknergseng 12y ago
Opinions on reactive vs promises?
- alipang 12y agoReactive (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).
- mattpodwysocki 12y agoReactive 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 https://gist.github.com/mattpodwysocki/b57cf50a34f22ba39e4f . This really shows where Promises leave off and true good composition starts.