mbest/knockout — Issue #6: trigger events when processing bindings 
Author: mbest
Created: 2011-12-17 09:33:41+00:00
State: open

Binding themselves can act as a sort of event handler: by creating a custom binding, you can do something when the binding manager first processes the element (init and then update) and whenever the dependencies of that binding change (update). The template binding also include custom event handlers (afterAdd, afterRender, and beforeRemove).

I propose (in addition to #3) to create some new events for Knockout. These would be koAfterInit and koAfterUpdate. koAfterInit is called right after all the binding's init functions have been set up. koAfterUpdate is called after all the binding's update functions have been called. koAfterUpdate will act differently when #1 is implemented. It will still be called after the update functions are run, but it probably won't be all of them that run. It might be nice to include which updates were run.