documentcloud/backbone — Issue #969: Using Backbone.Model.set with "silent" option doesn't clear out previous attributes.
Author: bialecki
Created: 2012-02-07 16:13:06+00:00
State: open

From the 0.9.0 documentation it appears this is by design, but it gives an odd behavior. Here's an example:

var Foo = Backbone.Model.extend();

var instance = new Foo();
instance.bind('change', function (model, value) {
console.log(model.changedAttributes());
});

instance.set({ bar: 1 }, { silent: true });
instance.set({ baz: 2 });
// I get { bar: 1, baz: 2 } logged.
// I'd expect { baz: 2 }

I'd think of this as "staging" a change since that's really what it's doing. If I want to change a model property, not trigger any change events, but also not trigger change events in the future, what's the recommended way of doing that? Can I do that without creating a new model instance?