Pasvaz / bindonce

Zero watches binding for AngularJs
2.73k stars 278 forks source link

Support of manual updating of the binding #100

Open pjfsilva opened 10 years ago

pjfsilva commented 10 years ago

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?

mgoodfellow commented 10 years ago

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: https://github.com/Pasvaz/bindonce/issues/42

ThomasDalla commented 9 years ago

+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.