DOM EventStreams (take two on Streams): Request for feedback

Tab Atkins Jr. jackalmage at gmail.com
Thu Apr 18 17:43:37 PDT 2013


I've updated my blog post with a refactoring of the API:
<http://www.xanthir.com/b4PV0>.

I hadn't fully appreciated the underlying abstraction of futures (that
they are the representation of async control flow), and so I was
designing the stream API in an inconsistent way.  This has been fixed,
so now Event Streams are far more consistent.  The core function is
.then(), and its callbacks can all be called multiple times.  (Streams
can adopt other streams, and when those streams reject, listener's
reject callbacks are called.)  If I have engineered things correctly,
this makes Streams consistently represent an async loop.

I've also reorganized the blog post for easier reading, separating out
the "basic" operations from the constructor functions and the
combinators.  I've also made a saner API for ValueStream (previously
called UpdateStream), and temporarily killed the text about a lossless
single-listener stream until I'm sure I've got the semantics right for
the lossy multi-listener cases.

The big thing I'm concerned with is the semantics of adoption.  I'm
very unsure I've gotten it right, but I've stared at it too long for
now, and can't think about it anymore.

~TJ


More information about the es-discuss mailing list