declarativewidgets
declarativewidgets copied to clipboard
Allow multiple watchers on channel/var combination for `channel().watch()`
Currently, doing channel('foo').watch('baz', ...)
will only work for the last such call with that combination of channel name and variable strings (last one wins). The API should allow multiple such watchers to register, to allow true broadcast usage.
After you mentioned this today I gave it some thought and we should be careful since there is no unwatch().
Wherever we store the list of watcher would have to be smart to detect names of functions sent to watch(). If we don't do this, reexecuting cells will just accumulate watchers.