Skip to content
This repository has been archived by the owner on Aug 19, 2019. It is now read-only.

start-runner/concurrent

Repository files navigation

start-concurrent

npm linux build windows build coverage deps

Concurrent tasks runner for Start.

💁 See also start-parallel.

Install

npm install --save-dev start-concurrent
# or
yarn add --dev start-concurrent

Usage

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.