Re: [whatwg/streams] Add explainer for WritableStreamDefaultController's AbortSignal (#1162)

@ricea commented on this pull request.

lgtm, but let's wait and see if @domenic or @MattiasBuelens have any comments.

> +## Examples
+
+These are some examples of Javascript which can be used for writable streams once this is implemented:
+
+In this example, the underlying sink write waits 1 second to simulate a long-running operation. However, if abort() is
+called it stops immediately.
+
+
+```javascript
+const ws = new WritableStream({
+  write(controller) {
+    return new Promise((resolve, reject) => {
+      setTimeout(resolve, 1000);
+      controller.signal.addEventListener('abort',
+        () => reject(controller.abortReason()));
+});

I think we're missing two '}' 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/pull/1162#pullrequestreview-741622956

Received on Monday, 30 August 2021 13:06:49 UTC