asyncobject: fire hooks before events.
This commit is contained in:
parent
3c4bee11f2
commit
664cddac42
@ -176,10 +176,10 @@ AsyncObject.prototype.hook = function hook(type, handler) {
|
||||
* @returns {Promise}
|
||||
*/
|
||||
|
||||
AsyncObject.prototype.fire = function fire() {
|
||||
AsyncObject.prototype.fire = co(function* fire() {
|
||||
yield this.fireHook.apply(this, arguments);
|
||||
this.emit.apply(this, arguments);
|
||||
return this.fireHook.apply(this, arguments);
|
||||
};
|
||||
});
|
||||
|
||||
/**
|
||||
* Emit an asynchronous event (hook).
|
||||
|
||||
Loading…
Reference in New Issue
Block a user