I have a computed function that notifies a button if it should be disabled or not.
I also have a subscribe to this computed function that updates an another observable. When this observable is updated, it runs a custom binding.
The problem is that the subscribe() is running before the button is disabled. I want the computed function to run first, then the button is enabled/disabled, and finally it runs the subscription..
Is this possible? setTimeout() is not a good option.
this.enableButton = ko.computed(function() { return true or false });
this.enableButton.subscribe(function() { myself.triggerBinding(true) });
html:
<button data-bind="enable: enableButton" />
If I understand you correctly I hope this helps:
http://jsfiddle.net/UHgTS/1