Concurrent tasks runner for Start.
💁 See also start-parallel.
npm install --save-dev start-concurrent
# or
yarn add --dev start-concurrent
import Start from 'start';
import reporter from 'start-pretty-reporter';
import concurrent from 'start-concurrent';
const start = Start(reporter());
const task1 = () => {
return function task1() {
return new Promise((resolve) => {
setTimeout(() => {
resolve();
}, 200);
});
};
};
const task2 = () => {
return function task2() {
return new Promise((resolve) => {
setTimeout(() => {
resolve();
}, 100);
});
};
};
export const task12 = () => start(
concurrent(
task1,
task2
)
);
→ concurrent: start
→ task1: start
→ task2: start
→ task2: done
→ task1: done
→ concurrent: done
See documentation for details.