Sha256: 49ae7023376eb1de0bb24b65650c7fab9760b6e3e2fdaa7c538992ee0016fc6a
Contents?: true
Size: 489 Bytes
Versions: 10
Compression:
Stored size: 489 Bytes
Contents
type ReadyHandlerFunc = () => void; const readyHandlers: ReadyHandlerFunc[] = []; const handleState = () => { if (["interactive", "complete"].indexOf(document.readyState) > -1) { while (readyHandlers.length > 0) { readyHandlers.shift()(); } } }; class ReadyHandler { constructor() { document.onreadystatechange = handleState; } ready(handler: ReadyHandlerFunc) { readyHandlers.push(handler); handleState(); } } export default new ReadyHandler();
Version data entries
10 entries across 10 versions & 1 rubygems