Files
prestashop/admin_o2w/themes/new-theme/js/components/on-ready.ts
2026-04-09 18:31:51 +02:00

14 lines
366 B
TypeScript

/**
* For the full copyright and license information, please view the
* docs/licenses/LICENSE.txt file that was distributed with this source code.
*/
const onReady = (callback: () => void): void => {
if (document.readyState !== 'loading') {
callback();
} else {
document.addEventListener('DOMContentLoaded', callback);
}
};
export default onReady;