Promises vs Streams

Domenic Denicola d at domenic.me
Sat Mar 28 16:44:57 UTC 2015


The same argument also implies that arrays are more powerful than scalar values, and we should e.g. never use a number when we could instead just use a single-element array with a number.

From: es-discuss [mailto:es-discuss-bounces at mozilla.org] On Behalf Of Boopathi Rajaa
Sent: Saturday, March 28, 2015 08:15
To: es-discuss at mozilla.org
Subject: Promises vs Streams

I feel this must have already been discussed but couldn't find any discussion threads, just trying to understand them better.

The basic doubt is that I feel promises are more like streams, and that streams are much more powerful than promises. With a promise you have a value or an exception, and with a stream, you have a list of values or an exception.

Why do we have both ? or more specifically, since we have both, when to use Promises and when to use Streams ? Whatever I imagine to be a Promise can be thought out to be solved by Streams, and sometimes whenever I use streams, it feels like I'm using similar API as Promises.

- Boopathi
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.mozilla.org/pipermail/es-discuss/attachments/20150328/023105d2/attachment-0001.html>


More information about the es-discuss mailing list