Skip to content

change:attribute on unchanged attribute [philosophic] #1664

Closed
@stegrams

Description

var m = new Backbone.Model({mod: 7});

m.on("change:mod", function(model, mod){
      console.log("mod changed from " + m.previous("mod") + " to " + mod);
 });

m.set("mod", 8, {silent:true});
m.set("mod", 7);
// mod changed from 7 to 7

Is this an expected behaviour?
Wouldn 't be better if no event was triggered for unchanged resulting attributes?

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions