View befunctional.js
const withLogs = (fn) => (a, b) => { | |
console.log(a, b); | |
return fn(a, b); | |
} | |
const add = withLogs((a, b) => a + b); |
View async-asset-loader.js
var ASSET_TYPE = { | |
css: 'css', | |
js: 'js' | |
}; | |
function loadCss(source) { | |
return new Promise(function(resolve, reject) { | |
var link = document.createElement('link'); | |
link.type = "text/css"; | |
link.rel = "stylesheet"; |