-
Notifications
You must be signed in to change notification settings - Fork 34
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
components) Add afterRender
#24
Comments
The class AfterBindingHandler extends ko.AsyncBindingHandler {
constructor (params) {
super(params)
applyBindingsToDescendants(this.$context, this.$element)
.then(this.completeBinding) // notify parent bindings that this binding is done
.then(this.value) // this.value is the `valueAccessor()`, presumably a function.
}
get controlsDescendants () { return true }
} Then, once registered as e.g. <span data-bind='after: callback'></span> where I think this is a reasonable solution for the problem of callbacks being called when a component is done rendering. That said, it's not the same as I'd accept the equivalent of the PR from knockout/knockout#1944 for Please share if you think there are other or better options! |
Maybe do constructor (...params) {
super(...params)
// ...
} to make it even more future-proof. |
The |
awesome! |
Closing in lieu of #47 (just for ease of reference) |
Per knockout/knockout#1944
Noting comment by @jmvtrinidad on tko.computed issue (pre-monorepo):
The text was updated successfully, but these errors were encountered: