Skip to content

Commit

Permalink
fix: rename var
Browse files Browse the repository at this point in the history
  • Loading branch information
willfarrell committed Oct 18, 2024
1 parent c6cb209 commit ba24146
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions plugin/multi.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ const multiPlugin = (opts = {}) => {
return {}
}

const flows = {
const hooks = {
beforePrefetch: [],
requestStart: [],
beforeMiddleware: [],
Expand All @@ -21,7 +21,7 @@ const multiPlugin = (opts = {}) => {

const push = (id, plugin) => {
if (plugin[id]) {
flows[id].push(plugin[id])
hooks[id].push(plugin[id])
}
}
for (let i = 0, l = plugins.length; i < l; i++) {
Expand All @@ -35,13 +35,13 @@ const multiPlugin = (opts = {}) => {
push('requestEnd', plugin)
}

flows.afterMiddleware.reverse()
flows.afterHandler.reverse()
flows.requestEnd.reverse()
hooks.afterMiddleware.reverse()
hooks.afterHandler.reverse()
hooks.requestEnd.reverse()

const run = (id) => {
for (let i = 0, l = flows[id].length; i < l; i++) {
flows[id]()
for (let i = 0, l = hooks[id].length; i < l; i++) {
hooks[id]()
}
}
return {
Expand Down

0 comments on commit ba24146

Please sign in to comment.