Skip to content

Instantly share code, notes, and snippets.

@hzhu
Last active November 10, 2015 23:25
Show Gist options
  • Save hzhu/7777970a8e54f650df66 to your computer and use it in GitHub Desktop.
Save hzhu/7777970a8e54f650df66 to your computer and use it in GitHub Desktop.
Reagent Register document.readyState
(defn register-dom-complete []
(aset js/document "onreadystatechange"
(fn [x]
(let [ready-state (.-readyState js/document)]
(if (= ready-state "complete")
(js/alert "DOM has completely loaded: invoke your callbacks here.")
)))))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment