asyncToGenerator.js 628 B

1234567891011121314151617181920212223242526
  1. function asyncGeneratorStep(n, t, e, r, o, a, c) {
  2. try {
  3. var i = n[a](c),
  4. u = i.value;
  5. } catch (n) {
  6. return void e(n);
  7. }
  8. i.done ? t(u) : Promise.resolve(u).then(r, o);
  9. }
  10. function _asyncToGenerator(n) {
  11. return function () {
  12. var t = this,
  13. e = arguments;
  14. return new Promise(function (r, o) {
  15. var a = n.apply(t, e);
  16. function _next(n) {
  17. asyncGeneratorStep(a, r, o, _next, _throw, "next", n);
  18. }
  19. function _throw(n) {
  20. asyncGeneratorStep(a, r, o, _next, _throw, "throw", n);
  21. }
  22. _next(void 0);
  23. });
  24. };
  25. }
  26. export { _asyncToGenerator as default };