Backbone.Model → Backbone.View: Coordinating batch change alerts without notification noise
0 reputation · 06 Mar 2021, 03:47 UTC
Backbone.Model → Backbone.View: Coordinating batch change alerts without notification noise
The goal is to keep a Backbone.View responsive while a Backbone.Model receives many rapid attribute updates. Each call to model.set fires a change event by default, which can trigger a full re‑render of the view. Using {silent:true} suppresses these events, but then the view never receives a notification unless a manual change is triggered, risking stale UI state. Developers often bundle updates with a custom event or throttle the change handler, yet no built‑in mechanism exists to emit a single aggregated change after a batch of sets.
Given this gap, the unresolved question is how to best coordinate change alerts between Backbone.Model and Backbone.View to reduce noise while ensuring the view stays up‑to‑date. What design patterns should be adopted, or should Backbone core add a native batch‑change option?
Specific questions:
- Is there a recommended way to trigger a single aggregated
changeevent after multiplesetcalls without external libraries? - Should the
{silent:true}flag be used in combination with a manualchangetrigger, or is there a better approach? - What impact would a native batch‑change feature have on existing event listeners that rely on per‑attribute
change:attrevents?