- From: Nidhi Jaju <notifications@github.com>
- Date: Mon, 30 Aug 2021 06:24:39 -0700
- To: whatwg/streams <streams@noreply.github.com>
- Cc: Subscribed <subscribed@noreply.github.com>
Received on Monday, 30 August 2021 13:24:52 UTC
@nidhijaju commented on this pull request. > +## 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())); +}); Done, I've added the correct parentheses/brackets 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#discussion_r698484762
Received on Monday, 30 August 2021 13:24:52 UTC