abiA
Denoβ€’3y agoβ€’
1 reply
abi

Remove sink from stream

Is it at all possible to "undo" adding a sink on a stream? I am trying to make it so that once the writable stream fulfills some condition, it should stop reading from the readable.

someProcess.stderr.pipeTo(
  new WritableStream({
    write(chunk, controller) {
      if (someCondition()) {
        // how the heck do i "undo" this sink?
        // i want to stop processing here, and i don't care what
        // happens to stderr after this point.
      }
    },
  }),
);
Was this page helpful?