backbone-nested
backbone-nested copied to clipboard
Setting data inside an array fires an add event on the parent array
I put together this jsfiddle to show what I mean.
http://jsfiddle.net/uz6VF/1/
I'd expect to only see one 'added' displayed but seeing three. I've narrowed it down to this line
https://github.com/afeld/backbone-nested/blob/master/backbone-nested.js#L262
but cant see an obvious fix. Any ideas?
Hmm, yep, add()
is using set()
under the hood, but should probably be checking isNewValue
(or something) before firing that event. Looking into it now.