Last active
August 29, 2015 13:57
-
-
Save zaiste/9926647 to your computer and use it in GitHub Desktop.
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 news-list-view [app owner opts] | |
(reify | |
om/IInitState | |
(init-state [_] | |
{:star (chan)}) | |
om/IWillMount | |
(will-mount [_] | |
(let [star (om/get-state owner :star)] | |
(go (loop [] | |
(let [news-item (<! star)] | |
(.log js/console (pr-str news-item)) | |
(recur))))) | |
(go (loop [] | |
(let [widgets (<! (fetch-widgets (:url opts)))] | |
(om/update! app [:widgets] widgets)) | |
(<! (timeout (:poll-interval opts)))))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment