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

> +          enqueue2(StructuredClone(value));
> +        } else {
> +          enqueue1(value);
> +          enqueue2(value);
> +        }
> +      },
> +      e => {
> +        error1(e);
> +        error2(e);
> +      }
> +    );
> +  }
> +
> +  function maybeCancelSource() {
> +    if (canceled1 && canceled2) {
> +      reader.cancel([cancelReason1, cancelReason2]);

Fixed. It turns out to be a bit more complicated since we need to return a promise even to the first person to cancel, not just the second.

Unless we think the first should fulfill ASAP and the second should signal? I will mention below so it doesn't get lost in this old diff.

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

Received on Thursday, 19 March 2015 10:02:44 UTC