Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dtothefp/5c9b174d710adf317d98a0b165f7cd34 to your computer and use it in GitHub Desktop.
Save dtothefp/5c9b174d710adf317d98a0b165f7cd34 to your computer and use it in GitHub Desktop.
import _regeneratorRuntime from "@babel/runtime-corejs2/regenerator";
import _asyncToGenerator from "@babel/runtime-corejs2/helpers/esm/asyncToGenerator";
import _Promise from "@babel/runtime-corejs2/core-js/promise";
var wait = function wait() {
var duration = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 100;
return new _Promise(function (res) {
return setTimeout(res, duration);
});
};
export default
/*#__PURE__*/
_asyncToGenerator(
/*#__PURE__*/
_regeneratorRuntime.mark(function _callee() {
var duration,
_args = arguments;
return _regeneratorRuntime.wrap(function _callee$(_context) {
while (1) {
switch (_context.prev = _context.next) {
case 0:
duration = _args.length > 0 && _args[0] !== undefined ? _args[0] : 500;
console.log('WAITING', wait);
_context.next = 4;
return wait(duration);
case 4:
console.log('DONE');
case 5:
case "end":
return _context.stop();
}
}
}, _callee);
}));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment