Parallel tasks runner for Start.
💁 See also start-concurrent.
npm install --save-dev start-parallel
# or
yarn add --dev start-parallel
import Start from 'start';
import reporter from 'start-pretty-reporter';
import parallel from 'start-parallel';
const start = Start(reporter());
export const tasksRunner1 = (...params) => {
return function task1() {
return new Promise((resolve) => {
setTimeout(() => {
resolve();
}, 200);
});
};
};
export const tasksRunner2 = (...params) => {
return function task2() {
return new Promise((resolve) => {
setTimeout(() => {
resolve();
}, 100);
});
};
};
export const tasksRunner12 = (...params) => start(
parallel(
'taskRunner1',
'taskRunner2'
)(...params)
);
→ parallel: start
→ task2: start
→ task2: done
→ task1: start
→ task1: done
→ parallel: done
❗
- works only with exported tasks runners