Skip to content

Instantly share code, notes, and snippets.

@robinchew
Created July 13, 2016 09:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save robinchew/9b11d1d320a295a1cbfa762908b6bdb4 to your computer and use it in GitHub Desktop.
Save robinchew/9b11d1d320a295a1cbfa762908b6bdb4 to your computer and use it in GitHub Desktop.
(ns cloject.mithril)
(defn build [l]
(if (vector? l)
(apply js/m
(clj->js (for [i l]
(build i))))
(if (seq? l)
(clj->js (for [i l]
(build i)))
l)))
(defn mount [element attr]
(.mount js/m element (clj->js attr)))
(defn redraw []
(.redraw js/m))
(defn startComputation []
(.startComputation js/m))
(defn endComputation []
(.endComputation js/m))
(defn redraw-strategy [strategy]
(-> js/m .-redraw (.strategy strategy)))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment