logoalt Hacker News

mpweiheryesterday at 11:13 AM0 repliesview on HN

> For example, sync updates 100 items in a list changing their titles. Items are bound to a list in the UI. Thus, 100 unique title update events triggered.

Those "updates" go in the queue. When the UI gets around to updating itself, it looks at the queue and invalidates all the UI elements that refer to the model items in the queue.

It then updates those elements, using the coarsening to update larger elements in bulk if that becomes better.

> Button clicked -> model change -> view update -> new event triggered -> model or view updated again

Once again, that is not allowed. View updates are not allowed to trigger any events in MVC. A model → view update updates the view. That's it.

The only event is "model changed", so it also doesn't make sense for the view to generate those events.