Stop an event from triggering a change event in Backbone.js?

Answered
coderguy asked this question 11 months ago
coderguy on Mar 7, 2022 · Edited

I have a web application that I'm building with Backbone.js.

When changing an attribute on one of my models, how can I stop the change events from being fired?

For example, here's one line of code I want to do this for:

users.first().set({"online": true});
2 suggested answers
nick on Mar 7, 2022

Add `{silent: true}' to your function call. It will stop the change event from being triggered.

users.first().set({"online": true}, {silent: true});
0 replies
moon_man41 on Mar 7, 2022

Use the silent option:

{silent: true}
0 replies
Answered