Re: [streams] First draft at tee algorithms, for critique (#302)

> +  const branch2 = new ReadableStream({
> +    start(enqueue, close, error) {
> +      [enqueue2, close2, error2] = [enqueue, close, error];
> +    },
> +    pull: readAndEnqueueInBoth,
> +    cancel(reason) {
> +      canceled2 = true;
> +      cancelReason2 = reason;
> +      maybeCancelSource();
> +    }
> +  });
> +
> +  return [branch1, branch2];
> +
> +  function readAndEnqueueInBoth() {
> +    reader.read().then(

Fixed. Watched it for errors only, otherwise the sequencing gets a bit screwy. I think that is correct since errors will clear the queue while closes will not.

---
Reply to this email directly or view it on GitHub:
https://github.com/whatwg/streams/pull/302/files#r26741156

Received on Thursday, 19 March 2015 10:03:51 UTC