How to use the ember-concurrency/utils.isGeneratorIterator function in ember-concurrency

To help you get started, we’ve selected a few ember-concurrency examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github machty / ember-concurrency / addon / iterators.js View on Github external
function _makeIteratorFromFunction(fn, context, args) {
  let value;

  if (args[0] instanceof Arguments) {
    value = fn.apply(context, args[0].args);
  } else {
    value = fn.apply(context, args);
  }

  if (isGeneratorIterator(value)) {
    return new GeneratorFunctionIterator(value);
  } else {
    return new RegularFunctionIterator(value);
  }
}