Skip to content

Commit

Permalink
fix: const names
Browse files Browse the repository at this point in the history
  • Loading branch information
Pierre Haller committed Feb 11, 2020
1 parent a12e779 commit 7d57872
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,16 +50,16 @@ export default userConfig => {

const unleash = async params => {
const gremlinsAndMogwais = [...config.gremlins, ...config.mogwais];
const beforeCallbacks = [...config.mogwais];
const afterCallbacks = gremlinsAndMogwais
const beforeHorde = [...config.mogwais];
const afterHorde = gremlinsAndMogwais
.map(beast => beast.cleanUp)
.filter(cleanUp => typeof cleanUp === 'function');

const horde = config.strategies.map(strat => strat.apply(null, [config.gremlins].concat(params)));

await executeInSeries(beforeCallbacks, []);
await executeInSeries(beforeHorde, []);
await Promise.all(horde);
await executeInSeries(afterCallbacks, []);
await executeInSeries(afterHorde, []);
};

const stop = () => config.strategies.forEach(strat => strat.stop());
Expand Down

0 comments on commit 7d57872

Please sign in to comment.