const writableStream = new WritableStream(
{
write(chunk) {
// …
},
close() {
// …
},
abort(err) {
// …
},
},
queuingStrategy,
);
// …
const writer = writableStream.getWriter();
// …
// abort the stream when desired
await writer.abort("WritableStream aborted. Reason: ...");WritableStreamDefaultWriter: abort() method / notebook
WritableStreamDefaultWriter: abort() method
Runnable notebook: every JavaScript, HTML and CSS example on this page executes in a sandboxed local frame. Nothing leaves the browser.