gab-social/app/javascript/gabsocial/ready.js
2019-07-02 03:10:25 -04:00

10 lines
212 B
JavaScript

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