asyncToGenerator.js 769 B

123456789101112131415161718192021222324252627
  1. var _Promise = require("core-js-pure/features/promise/index.js");
  2. function asyncGeneratorStep(n, t, e, r, o, a, c) {
  3. try {
  4. var i = n[a](c),
  5. u = i.value;
  6. } catch (n) {
  7. return void e(n);
  8. }
  9. i.done ? t(u) : _Promise.resolve(u).then(r, o);
  10. }
  11. function _asyncToGenerator(n) {
  12. return function () {
  13. var t = this,
  14. e = arguments;
  15. return new _Promise(function (r, o) {
  16. var a = n.apply(t, e);
  17. function _next(n) {
  18. asyncGeneratorStep(a, r, o, _next, _throw, "next", n);
  19. }
  20. function _throw(n) {
  21. asyncGeneratorStep(a, r, o, _next, _throw, "throw", n);
  22. }
  23. _next(void 0);
  24. });
  25. };
  26. }
  27. module.exports = _asyncToGenerator, module.exports.__esModule = true, module.exports["default"] = module.exports;