Created
April 20, 2019 16:05
-
-
Save dtothefp/5c9b174d710adf317d98a0b165f7cd34 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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