I ended up using babel to convert this portion of my code to work with IE11. Also I had to import a polyfill so the regeneratorRuntime function will work.
It became this which works across all browsers:
_asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee() {
return regeneratorRuntime.wrap(function _callee$(_context) {
while (1) {
switch (_context.prev = _context.next) {
case 0:
_context.prev = 0;
_context.next = 3;
return getLayers();
case 3:
_context.next = 8;
break;
case 5:
_context.prev = 5;
_context.t0 = _context['catch'](0);
console.error(_context.t0);
case 8:
case 'end':
return _context.stop();
}
}
}, _callee, this, [[0, 5]]);
}))();
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…