glitchier-soc/app/javascript/mastodon/ready.js

8 lines
197 B
JavaScript
Raw Normal View History

2017-11-18 05:16:35 +02:00
export default function ready(loaded) {
if (['interactive', 'complete'].includes(document.readyState)) {
loaded();
} else {
document.addEventListener('DOMContentLoaded', loaded);
}
}