How does the browser Web Streams API: cancel a stream that is already pipe?

browser side , not node.

ReadableStream / WritableStream works pretty well, but .pipeto returns a Promise of resolve on normal exit. If you want to cancel this pipe, what should I do?

for example:

async function saveToWebkitFS(url) {
  const readable = (await fetch(url)).body;

  //Chrome
  const writeable = await webkitFSWrapper.createWriteStream(url);

  return readable.pipeTo(writeable);
}

function abort(pipe) {
  // 
}
Mar.20,2021
Menu