Skip to content

Commit

Permalink
fix(app-hooks.js): pass the arg throught multiple calls in runPluginHook
Browse files Browse the repository at this point in the history
  • Loading branch information
amoncaldas committed Jul 20, 2021
1 parent cc57227 commit af08fea
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/support/app-hooks.js
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ class AppHooks {
}

/**
* Execute a hook of a plugin
* Execute a hook of a plugin
* @param {Object} hookName
* @param {String} arg
* @returns {Object} arg
Expand All @@ -113,7 +113,10 @@ class AppHooks {
for (let key in this.plugins) {
let plugin = this.plugins[key]
if (plugin && typeof plugin[hookName] === 'function') {
return plugin[hookName](arg)
let argReturned = plugin[hookName](arg)
if (argReturned !== undefined && argReturned !== null) {
arg = argReturned
}
}
}
}
Expand Down

0 comments on commit af08fea

Please sign in to comment.