Skip to content

Instantly share code, notes, and snippets.

@jwhitlark
Last active August 29, 2015 14:02
Show Gist options
  • Save jwhitlark/5831b282ecce8e15d1e6 to your computer and use it in GitHub Desktop.
Save jwhitlark/5831b282ecce8e15d1e6 to your computer and use it in GitHub Desktop.
Simple clock in Om
(defn clock-view [app owner]
(reify
om/IWillMount
(will-mount [_]
(js/setInterval
(fn [] (om/transact! app :time (fn [_] (js/Date.))))
100))
om/IRender
(render [_]
(dom/div nil (. (:time app) toUTCString)))))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment