-
-
Notifications
You must be signed in to change notification settings - Fork 5.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Trigger "changeId" need to be generate only if the content id change #4289
Comments
Thank you for reporting this. I was able to reproduce this with the following snippet of code: var attrs = {id: 1, fruit: 'banana'};
var m = new Backbone.Model(attrs);
m.on('all', console.log);
m.set(attrs);
// Logs "changeId" to the console, plus event payload. Before even trying that, I already took a peek at the code and immediately got a suspicion what might be causing this. The event is triggered here: Lines 523 to 527 in 4e64208
The condition of the One other thing I noticed while looking at the code: |
With the backbone-relation, the event change is often called. I need to change my code to avoid this. Is it possible to get a small version of this fix? |
@Noodlex this ticket only refers to the |
Affected component
The set function of backbone model
Expected behavior
Trigger "changeId" if the changeId is different of previous
Actual behavior
Always trigger "changeId"
Relevant documentation
No response
Software stack
Related issues, prior discussion and CCs
No response
Error
No response
Steps to reproduce
Additional information
No response
Suggested solution(s)
No response
Other remarks
No response
The text was updated successfully, but these errors were encountered: