Skip to content


Subversion checkout URL

You can clone with
Download ZIP


Setting same fires remove/add/sort #143

Muon opened this Issue · 3 comments

2 participants


Setting the same contents fires events even if nothing has changed, see fiddle for example:

@Muon Muon changed the title from Setting same fires add/remove/sort to Setting same fires remove/add/sort

Hmm, this seems to be tied to the id attribute. Two models seems only seem to be considered same if they have the same id.

@dhruvaray dhruvaray added the question label
@dhruvaray dhruvaray self-assigned this

This is in line with Backbone behavior. We use Backbone's smart set method internally for 1:M relations.(all working on id)

From Backbone documentation

If you want to smartly update the contents of a Collection, adding new models, removing missing ones, and merging those already present, you now call set (previously named "update"), a similar operation to calling set on a Model. This is now the default when you call fetch on a collection. To get the old behavior, pass {reset: true}.

This internally calls add/remove/sort. Search for _addReference, _removeReference in


Hmm, that's awkward. So what should I do if my data is just... data? Just give them arbitrary different ids?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.