You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
As I see now, every callback given to data.on('DS.change', function(resource, data) { /*...*/ } is called with the modified data even if the data that changed is not the one it listens on. Updated the plnkr above to show the problem better.
The reason I want to listen on every instance separately is because I want to DSSave() them on change debounced independently.
The problem appears to be the implementation of Events that's being used. Events is mixed into the prototype of instance contructors, but doesn't correctly maintain a map of listeners, instead holding all listeners in one object, and therefore executing them all...
If I have n instances of a resource and modify one of them,
DS.change
is emitted n times on that one instance. Here's a plnkr.The text was updated successfully, but these errors were encountered: