Skip to content

Commit

Permalink
* Promises.js: removed hashOps, redundant. applyOps before firing "re…
Browse files Browse the repository at this point in the history
…alized" event.
  • Loading branch information
swannodette committed Sep 24, 2009
1 parent a853156 commit 64eaf12
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions Promises.js
Expand Up @@ -134,22 +134,20 @@ var Promise = new Class({
return this.value();
},

hasOps: function() { return this.__ops.length > 0; },

setValue: function(value, notify) {
if(value && value.xhr) {
this.initReq(value);
} else {
this.__value = value;
if(!this.__realized && notify !== false) {
this.__realized = true;
this.fireEvent('realized', this.__value);
this.fireEvent('realized', this.applyOps(this.__value));
}
}
},

value: function(applyOps) {
if(this.hasOps() && applyOps !== false) this.__value = this.applyOps(this.__value);
if(applyOps !== false) this.__value = this.applyOps(this.__value);
return this.__value;
},

Expand Down

0 comments on commit 64eaf12

Please sign in to comment.