Skip to content

Instantly share code, notes, and snippets.

@lahmatiy
Last active December 19, 2015 04:18
Show Gist options
  • Save lahmatiy/5895982 to your computer and use it in GitHub Desktop.
Save lahmatiy/5895982 to your computer and use it in GitHub Desktop.
Path to restore forceEvent argument and boolean result for basis.data.Value#set (dropped in 0.9.4)
basis.require('basis.data');
(function(){
var set_ = basis.data.Value.prototype.set;
basis.data.Value.prototype.set = function(value, forceEvent){
var valueBeforeSet = this.value;
set_.call(this, value);
var changed = this.value !== valueBeforeSet;
if (forceEvent && !changed)
this.emit_change(this.value, this.value);
return changed;
}
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment