不要怂,就是干,撸起袖子干!

Commit bc885159 by overlookmotel

Hooks run sync in sync functions

1 parent f3c6b1c1
Showing with 10 additions and 0 deletions
......@@ -100,6 +100,16 @@ Hooks.runHooks = function(hooks) {
hooks = hooks === undefined ? [] : [hooks];
}
// run hooks as sync functions if flagged as sync
if (hookTypes[hookType] && hookTypes[hookType].sync) {
hooks.forEach(function(hook) {
if (typeof hook === 'object') hook = hook.fn;
return hook.apply(self, fnArgs);
});
return;
}
// run hooks async
var promise = Promise.each(hooks, function (hook) {
if (typeof hook === 'object') {
hook = hook.fn;
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!