Created
April 20, 2019 16:04
-
-
Save dtothefp/a717c4e54f5b313d4f5e339731368204 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 _asyncToGenerator from "@babel/runtime/helpers/esm/asyncToGenerator"; | |
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