- From: Adam Rice <notifications@github.com>
- Date: Sun, 26 Jul 2020 23:40:14 -0700
- To: whatwg/streams <streams@noreply.github.com>
- Cc: Subscribed <subscribed@noreply.github.com>
Received on Monday, 27 July 2020 06:40:26 UTC
@ricea approved this pull request. lgtm > @@ -868,6 +868,49 @@ option. If {{UnderlyingSource/type}} is set to undefined (including via omission |options|["{{StreamPipeOptions/preventClose}}"], |options|["{{StreamPipeOptions/preventAbort}}"], |options|["{{StreamPipeOptions/preventCancel}}"], |signal|). + + <div class="example" id="example-pipe-abortsignal"> + An ongoing [=pipe=] operation can be stopped using an {{AbortSignal}}, as follows: + + <xmp highlight="js"> + const controller = new AbortController(); + readable.pipeTo(writable, { signal: controller.signal }); + + // ... some time later ... + controller.abort(); + </xmp> + + (The above omits error handling for the promise returned by {{ReadableStream/pipeTo()}}. Having two sentences inside "()" looks a little odd to me. I think you could just omit the "()" here. If you like. I don't have really strong feelings about it. -- 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/1059#pullrequestreview-455506776
Received on Monday, 27 July 2020 06:40:26 UTC