Skip to content

Latest commit

 

History

History
45 lines (34 loc) · 987 Bytes

API.md

File metadata and controls

45 lines (34 loc) · 987 Bytes

ember-concurrency API docs

All of ember-concurrency's public API is available on the "ember-concurrency" module, and most of the time, you'll only be using the task and timeout imports, e.g.:

import { task, timeout } from 'ember-concurrency';

export default Component.extend({
  loopingTask: task(function * () {
    while (true) {
      this.set('num', Math.random());
      yield timeout(100);
    }
  }).on('init')
});

Task Modifiers

You can find a description of all the Task Modifiers under the Task Property API docs.

The full API

import {
  task,    // task macro
  timeout, // pause execution

  // Task/cancelation-aware variants of Promise.all/race
  all,
  race,
} from 'ember-concurrency';