You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Apr 12, 2024. It is now read-only.
I'm not sure if this has been brought up before; I couldn't find any prior discussion. Maybe someone can point me in the correct way.
We now have one-time binding with {{ ::foo }}.
Another use-case I'd consider very useful is a binding that will continue updating while a certain expression is true, and then become unbound once it returns false.
In this case, once Job.status has been update to finished or error, it can remove the watcher because Job.isActive() will return false, so it knows that it will no longer continue changing.
I have a lot of bindings in which I only want temporary bindings, this would help to reduce the number of watchers.
Would there be any interest in having some sort of concept of manually triggered bindings? For a lot of my data sets I'll usually know when they're changing (for example, if it's data coming from the server that I'm refreshing), so instead of having to check them in every cycle, I could manually trigger when they've changed. It's not great, and it's probably not that useful now that there's Object.observe; has it been discussed? I've considered implementing a directive to sorta do this for me, by registering listeners and emitting events through a service or something along those lines.
The text was updated successfully, but these errors were encountered:
so, there has been some talk about supporting groups of watches which can be enabled/disabled imperatively. It's been thrown away for now, but might come back in the future (we do want it).
This, however, is essentially "watch this one expression, and if it's truthy, also watch this other expression", which seems kinda weird, and not at all a performance enhancement
Maybe I wasn't clear, I was thinking: watch Job.status while Job.isActive() is truthy. Once Job.isActive() stops being truthy, remove both watches. Even if Job.isActive() were to become truthy later, it'll no longer be watched.
Basically, stop watching once a certain condition is met, because I know it's no longer going to get updated.
I'm not sure if this has been brought up before; I couldn't find any prior discussion. Maybe someone can point me in the correct way.
We now have one-time binding with
{{ ::foo }}
.Another use-case I'd consider very useful is a binding that will continue updating while a certain expression is true, and then become unbound once it returns false.
For example:
In this case, once Job.status has been update to finished or error, it can remove the watcher because
Job.isActive()
will return false, so it knows that it will no longer continue changing.I have a lot of bindings in which I only want temporary bindings, this would help to reduce the number of watchers.
Would there be any interest in having some sort of concept of manually triggered bindings? For a lot of my data sets I'll usually know when they're changing (for example, if it's data coming from the server that I'm refreshing), so instead of having to check them in every cycle, I could manually trigger when they've changed. It's not great, and it's probably not that useful now that there's Object.observe; has it been discussed? I've considered implementing a directive to sorta do this for me, by registering listeners and emitting events through a service or something along those lines.
The text was updated successfully, but these errors were encountered: