0.2.8 • Published 5 years ago

concurrency-light v0.2.8

Weekly downloads
4
License
MIT
Repository
github
Last release
5 years ago

concurrency-light

Lightweight concurrency management, heavily inspired by ember-concurrency.

Installation

  • yarn add concurrency-light
  • npm install --save concurrency-light

Usage

import { task, TaskStrategy, timeout } from "concurrency-light";

class DocClass {
  constructor() {
    this.asyncSearch("pants");
    this.asyncSearch.isRunning; // true
    this.asyncSearch("skirts"); // restarted
  }

  @task({ strategy: TaskStrategy.Restart })
  *asyncSearch(search: string) {
    yield timeout(500);
    yield fetch(`/api/search?filter[query]=${search}`);
  }
}
0.2.8

5 years ago

0.2.7

5 years ago

0.2.6

5 years ago

0.1.6

5 years ago

0.1.5

5 years ago

0.1.4

5 years ago

0.1.3

5 years ago

0.1.2

5 years ago

0.1.1

5 years ago