soapbox/app/gabsocial/ready.js

10 wiersze
212 B
JavaScript

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