(callback: () => void)
| 17 | * If the document is already loaded, the callback is executed in the next event loop |
| 18 | */ |
| 19 | export function onDOMReady(callback: () => void): void { |
| 20 | bindReady(); |
| 21 | if (isReady) { |
| 22 | setTimeout(callback); |
| 23 | } else { |
| 24 | readyList?.push(callback); |
| 25 | } |
| 26 | } |
| 27 | |
| 28 | /** |
| 29 | * initialize the readyList and bind the necessary events |
no test coverage detected