Guest User

Untitled

a guest
Jun 21st, 2018
81
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.28 KB | None | 0 0
  1. ko.subscribable.fn.subscribeChanged = function( callback ) {
  2. var oldValue;
  3. return [
  4. this.subscribe( function( _oldValue ) {
  5. oldValue = _oldValue;
  6. }, this, 'beforeChange' ),
  7. this.subscribe( function( newValue ) {
  8. callback( newValue, oldValue );
  9. } )
  10. ];
  11. };
Add Comment
Please, Sign In to add comment