Permalink
Browse files

onError and onSuccess chainable

  • Loading branch information...
1 parent 76e2e46 commit 9d68eda81f8fd1ffcd3319320163121036a1748b @pascalopitz committed Mar 11, 2013
Showing with 2 additions and 0 deletions.
  1. +2 −0 lib/beanstalk_client.js
View
2 lib/beanstalk_client.js
@@ -54,10 +54,12 @@ BeanstalkCommand.prototype.onEnd = function(fn) {
BeanstalkCommand.prototype.onError = function(fn) {
this.addListener('command_error', fn);
+ return this;
};
BeanstalkCommand.prototype.onSuccess = function(fn) {
this.addListener('command_success', fn);
+ return this;
};
BeanstalkCommand.prototype.responseHandler = function(data, obj, callback) {

0 comments on commit 9d68eda

Please sign in to comment.