Last active
August 29, 2015 13:58
-
-
Save yedi/9985991 to your computer and use it in GitHub Desktop.
why doesn't (:analysis data) return a ListCursor?
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 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