Files

14 lines
366 B
TypeScript
Raw Permalink Normal View History

/**
* 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;