tc39 / proposal-signals

A proposal to add signals to JavaScript.
MIT License
2.87k stars 54 forks source link

"Signal.subtle.Watcher.prototype.watch(...signals)" phase 4 is vague #205

Open prophile opened 2 weeks ago

prophile commented 2 weeks ago

In "Method: Signal.subtle.Watcher.prototype.watch(...signals)" we have:

  1. Add this watcher as a sink to each Signal. If this was the first sink, then recurse up to sources to add that signal as a sink, and call the watched callback if it exists.

It's not immediately clear for the first sentence whether this means the newly watched signals (which is spelled out explicitly in phase 3 immediately beforehand) or all sources.

It's also not clear what "recurse up to the sources" means; especially with the watched callback being called I think it's worth being quite explicit about the algorithm and ordering here.