Skip to content

Instantly share code, notes, and snippets.

@ide
Last active September 2, 2016 20:04
Show Gist options
  • Save ide/555a110a4a1d13e1eafe7e2db322ccbd to your computer and use it in GitHub Desktop.
Save ide/555a110a4a1d13e1eafe7e2db322ccbd to your computer and use it in GitHub Desktop.
Comparing Babel + Uglify with Babel + Babili (with pretty-printing, September 2016)
async function getTemperatureForecastAsync() {
let response = await fetch('/forecast.json');
let result = await response.json();
return result.temperature;
}
var getTemperatureForecastAsync = function () {
var e = _asyncToGenerator(regeneratorRuntime.mark(function n() {
var e, a;return regeneratorRuntime.wrap(function (n) {
for (;;) switch (n.prev = n.next) {case 0:
return n.next = 2, fetch("/forecast.json");case 2:
return e = n.sent, n.next = 5, e.json();case 5:
return a = n.sent, n.abrupt("return", a.temperature);case 7:case "end":
return n.stop();}
}, n, this);
}));return function () {
return e.apply(this, arguments);
};
}();
let getTemperatureForecastAsync = (() => {
var ref = _asyncToGenerator(function* () {
let a = yield fetch('/forecast.json'),
b = yield a.json();return b.temperature;
});return function getTemperatureForecastAsync() {
return ref.apply(this, arguments);
};
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment