Re: [whatwg/streams] Synchronous (or asynchronous) state probing on WritableStream (#463)

Code to put multiple elements respecting back pressure would be like:

```
const values = [ ... ];
function writeData() {
  const value = values.shift();
  writer.write(v);
  Promise.race(writer.closed, writer.ready).then(() => {
    writeData();
  }).catch(r => {
    // Failed
  });
}
```

Hmm, ok. Let's proceed with the plan to just remove state. If I see any new issue in writing pipeTo, transform stream, I'll report here.


---
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/whatwg/streams/issues/463#issuecomment-224886866

Received on Thursday, 9 June 2016 13:00:39 UTC