New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Binding handlers should be able to use the init function to manage updates #500
Comments
Wow, we're at 500 issues! |
This particular issue causes me problems frequently. |
Once #321 is in, this will be easy. |
I'd also like to add that observables accessed directly in |
I am on board with that change too. I always thought it was odd for the init to register what amounts to a one-time dependency. |
Another related issue is that when an element has multiple bindings, the |
This will have a side-effect that if the value of a binding is the result of a function call, that function will be run each time |
That side-effect sounds reasonable to me. Does not sound like a problematic change. |
Completed with #946. |
Currently a binding handler that uses a computed observable created in its
init
function to manage updates won't work in all cases.It will work if the observable value is directly available through the
valueAccessor
function and can be "unwrapped" in the computed observable.It will not work if an observable is unwrapped when the binding is parsed or if an observable view model is used.
An advantage of using this pattern is that one can set up persistent values in the
init
function that will be available during updates via closure.In order to fully support this pattern, the
valueAccessor
function must provide notification for all observables that may cause the binding to update.The text was updated successfully, but these errors were encountered: