engelsystem/resources/assets/js/ready.js

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

11 lines
213 B
JavaScript
Raw Normal View History

2022-12-10 14:56:10 +01:00
/**
* @param {Function} callback
*/
2022-11-29 19:19:30 +01:00
export const ready = (callback) => {
if (document.readyState !== 'loading') {
callback();
} else {
document.addEventListener('DOMContentLoaded', callback);
}
2022-12-22 18:28:51 +01:00
};