- From: Takeshi Yoshino <notifications@github.com>
- Date: Thu, 05 Feb 2015 00:56:19 -0800
- To: whatwg/streams <streams@noreply.github.com>
Received on Thursday, 5 February 2015 08:56:47 UTC
> + }
> + });
> +
> + t.equal(rs.state, 'waiting', 'stream starts out waiting');
> +
> + rs.ready.then(() => {
> + t.equal(rs.state, 'readable', 'stream becomes readable (even before promise fulfills)');
> + t.equal(timesCalled, 1, 'pull is not yet called a second time');
> + t.equal(rs.read(), 1, 'read() returns enqueued value');
> +
> + setTimeout(() => {
> + t.equal(timesCalled, 1, 'after 30 ms, pull has still only been called once');
> +
> + resolve();
> +
> + returnedPromise.then(() => {
looks a little misleading. can't we just use Promise.resolve(undefined).then(...) or setTimeout(..., 0)?
---
Reply to this email directly or view it on GitHub:
https://github.com/whatwg/streams/pull/272/files#r24150104
Received on Thursday, 5 February 2015 08:56:47 UTC