0
0
Fork 0
mirror of https://github.com/lunaisnotaboy/mastodon.git synced 2025-01-05 20:17:27 +00:00
mastodon/app/javascript/flavours/glitch/util/ready.js
2017-12-03 23:26:40 -08:00

8 lines
197 B
JavaScript

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