Watch.JS icon indicating copy to clipboard operation
Watch.JS copied to clipboard

WatchJS does multiple callbacks when we push an element on a watched Array

Open mritzman opened this issue 12 years ago • 1 comments

If you have multiple watchers for an array and push an element, WatchJS calls EACH watcher as many as the number of total watchers on the array. For example, if you have an array with two watchers, EACH watcher is called two times when an element is pushed onto the array. If you have an array with three watchers, each watcher is called three times when an element is added...

This is problem is reproduced with here: http://jsfiddle.net/66zzW/

Here is a screenshot showing the problem: watchjsproblem

mritzman avatar Jan 03 '14 17:01 mritzman

This seems to be the case for any change:

http://jsfiddle.net/mhelvens/7q9rrLya/1/

That's pretty important.

mhelvens avatar Aug 07 '14 09:08 mhelvens