Skip to content

Instantly share code, notes, and snippets.

@yedi
Last active August 29, 2015 13:58
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 yedi/9985991 to your computer and use it in GitHub Desktop.
Save yedi/9985991 to your computer and use it in GitHub Desktop.
why doesn't (:analysis data) return a ListCursor?
(defn combo-view [data owner]
(print (type data)) ; prints cljs.core/PersistentHashMap
(reify
om/IRender
(render [this]
(apply d/div nil
(d/strong nil (str/join "-" (:value data)))
(let [streams (if (:extended data)
(nth (:streams data) 0)
(take 3 (nth (:streams data) 0)))
stream-divs (map #(d/div nil %) (rstreams->words streams))]
(if-not (:extended data)
(concat stream-divs
[(d/a #js {:onClick #(om/update! data [:extended] true) :href "#"}
(d/small nil "more..."))])
stream-divs))))))
(defn combos-view [data owner]
(print (type data)) ; prints om.core/MapCursor
(print (type (get-in data [:analysis]))) ; prints cljs.core/List
(print (type (:analysis data))) ; prints cljs.core/List
(reify
om/IRender
(render [this]
(apply d/div #js {:className "col-xs-6"}
(om/build-all combo-view (get-in data [:analysis]))))))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment