Created
March 4, 2025 00:47
-
-
Save piouc/1111f1fa90f83ffc7963cc346dc99f99 to your computer and use it in GitHub Desktop.
js utils
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const waitForLoad = fn => { | |
if(document.readyState === 'loading'){ | |
document.addEventListener('DOMContentLoaded', fn) | |
} else { | |
fn() | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment