Last active
August 29, 2015 14:02
-
-
Save jwhitlark/5831b282ecce8e15d1e6 to your computer and use it in GitHub Desktop.
Simple clock in Om
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(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