declarativewidgets icon indicating copy to clipboard operation
declarativewidgets copied to clipboard

Allow multiple watchers on channel/var combination for `channel().watch()`

Open jhpedemonte opened this issue 9 years ago • 1 comments

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.

jhpedemonte avatar Oct 13 '15 20:10 jhpedemonte

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.

lbustelo avatar Oct 13 '15 22:10 lbustelo