Skip to content

Commit

Permalink
Removing automatic .run being called in promises
Browse files Browse the repository at this point in the history
  • Loading branch information
thejsj committed Apr 1, 2015
1 parent 53e2040 commit 2578293
Showing 1 changed file with 17 additions and 13 deletions.
30 changes: 17 additions & 13 deletions lib/term.js
Original file line number Diff line number Diff line change
Expand Up @@ -2624,19 +2624,23 @@ Term.prototype.rebalance = function() {
return term;
}


Term.prototype.then = function(resolve, reject) {
return this.run().then(resolve, reject);
}
Term.prototype.error = function(reject) {
return this.run().error(reject);
}
Term.prototype.catch = function(reject) {
return this.run().catch(reject);
}
Term.prototype.finally = function(handler) {
return this.run().finally(handler);
}
/**
* I (@thejsj) am not that lazy. I don't mind writing `.run`
* What I lose is the ability to return queries through promises, which
* is a pretty powerful feature
*/
// Term.prototype.then = function(resolve, reject) {
// return this.run().then(resolve, reject);
// }
// Term.prototype.error = function(reject) {
// return this.run().error(reject);
// }
// Term.prototype.catch = function(reject) {
// return this.run().catch(reject);
// }
// Term.prototype.finally = function(handler) {
// return this.run().finally(handler);
// }


Term.prototype.toString = function() {
Expand Down

0 comments on commit 2578293

Please sign in to comment.