0
0
Fork 0

Do not load unnecessary script files (#4193)

This commit is contained in:
Yamagishi Kazutoshi 2017-07-14 18:08:56 +09:00 committed by Eugen Rochko
parent 87b96f8d33
commit 9008ab3407
5 changed files with 39 additions and 28 deletions

View file

@ -0,0 +1,7 @@
export default function ready(loaded) {
if (['interactive', 'complete'].includes(document.readyState)) {
loaded();
} else {
document.addEventListener('DOMContentLoaded', loaded);
}
}