prefer arrow functions

Signed-off-by: marcin mikołajczak <git@mkljczk.pl>
This commit is contained in:
marcin mikołajczak
2024-05-12 15:24:15 +02:00
parent afa677a375
commit cb7976bd3d
11 changed files with 134 additions and 121 deletions

View File

@ -1,7 +1,9 @@
export default function ready(loaded: () => void): void {
const ready = (loaded: () => void): void => {
if (['interactive', 'complete'].includes(document.readyState)) {
loaded();
} else {
document.addEventListener('DOMContentLoaded', loaded);
}
}
};
export default ready;