包含一堆全局的公用方法(例如runOnWindowLoad)和js api的扩展(例如promise和map的扩展), 无外部依赖 ,按理来说他应该叫util
function runOnWindowLoad(callback) { /** * @suppressGlobalPropertiesCheck */ function windowLoaded() { self.removeEventListener('DOMContentLoaded', windowLoaded, false); callback(); } if (document.readyState === 'complete' || document.readyState === 'interactive') callback(); else self.addEventListener('DOMContentLoaded', windowLoaded, false); }
Last updated 5 years ago