Pasvaz/bindonce

Support of manual updating of the binding

pjfsilva opened this issue · 2 comments

This is a bit weird to ask for because bindOnce is supposed to be that: bindOnce :)

But in my case I want to improve overall performance using bindOnce but have a way to manually flag the values to be reprocessed sometimes.

My use case is that I have a large table with many rows where the columns use some filters and expressions. The table can use bindOnce after the initial load but I'm also receiving updates for it's data. I want to be able to "signal" the table to be updated and then stop again the watchers.
The problem with 2 way binding is that for every dirty model checking angular is running all my table filters and expressions which can take a bit of time.

Basically I want a manual control for the binding to work: it should only re-bind when I explicitly call some function or something like that.

This is a good idea for this:
https://github.com/kseamon/fast-bind/blob/master/src/directives/bind-on-notify/bind-on-notify.js

Do you predict the support for these kind of things?

There is a currently open issue discussing options on this, although there is not a stable solution yet.

There is a branch for "rebind" but I personally haven't had a play with it yet.

See: #42

+1
This is a great tool for optimising performance, but it would be even better if we could rebind selected divs for data that doesn't change often (not real time) but can still change.