engelsystem/resources/assets/js/ready.js

11 lines
212 B
JavaScript

/**
* @param {Function} callback
*/
export const ready = (callback) => {
if (document.readyState !== 'loading') {
callback();
} else {
document.addEventListener('DOMContentLoaded', callback);
}
}