Created
February 27, 2012 14:30
-
-
Save thelinuxlich/1924229 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** Dependent observable with callback on write */ | |
Function.prototype.intercept = function(callback) { | |
var underlyingObservable = this; | |
return ko.dependentObservable({ | |
read: underlyingObservable, | |
write: function(value) { callback.call(underlyingObservable, | |
value) } | |
}); | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment