Re: [whatwg/streams] Unified error handling for WritableStream (#721)

ricea commented on this pull request.



>  
-  assert(state === 'writable');
+  assert(state === 'writable' || state === 'erroring');

writer.close() is useful to wait for the sink to become quiescent. You can also do this with writer.closed, but that would mean writing code like

```javascript
return writer.close().catch(() => writer.closed);
```

Also I want this to just work without the developer having to think about it. If there is a developer error like calling close() twice on the same stream then close() will reject immediately, but otherwise it consistently waits for no underlying sink methods to be running.

write() never provides any such guarantee, so rejecting immediately when we know there is no hope of the write() working is the best behaviour.

-- 
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/pull/721#discussion_r111302676

Received on Thursday, 13 April 2017 03:00:03 UTC