Skip to content

Instantly share code, notes, and snippets.

@zaiste
Last active August 29, 2015 13:57
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 zaiste/9926647 to your computer and use it in GitHub Desktop.
Save zaiste/9926647 to your computer and use it in GitHub Desktop.
(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