export const documentReady = () => {
    return new Promise((resolve, reject) => {
        if (/loaded|interactive|complete/.test(document.readyState)) {
            resolve();
        } else {
            document.addEventListener('readystatechange', () => {
                if (/loaded|interactive|complete/.test(document.readyState)) {
                    resolve();
                }
            });
            document.addEventListener('DOMContentLoaded', () => resolve());
        }
    });
};
