Re: [whatwg/streams] Reconnecting a Stream after creating it - possible? (#1004)

One more thing: since we're _aborting_ the pipe, the pipe promise will reject with an `AbortError` instead of resolving. So we need to use `.catch()` instead of `.then()`:
```js
document.querySelector("#switch").onclick = () => {
  controller.abort();
  pipePromise.catch(() => {
    rsA.pipeTo(wsB);
  });
};
```
(You should probably check whether the rejection reason was actually an `AbortError`, but this should be good enough for demo purposes. 😛)

-- 
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/1004#issuecomment-511046429

Received on Friday, 12 July 2019 21:58:10 UTC