Last active
March 15, 2016 03:48
-
-
Save bpicolo/4de274cc4c6f49cc72d1 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
sub: | |
(register-sub | |
:tags | |
(fn [db _] | |
(reaction (vals (:tags @db))))) | |
handler: | |
(register-handler | |
:add-tag | |
(fn [db [text]] | |
(assoc db :tags [{:text "foo"}]))) | |
(defn tag-box [] | |
(let [tags (subscribe [:tags])] | |
(fn [] | |
[:div {:class "tag-box"} | |
(when (= (count @tags) 0) | |
[:span {:class "subtle-text"} "Your current tags will appear here."]) | |
(for [tag @tags] | |
[:li (:text tag)])]))) | |
Problem: | |
Error rendering component ( | |
in foo.bar.views.marketing_builder_app > | |
foo.bar.views.tag_builder_view > | |
foo.bar.views.tag_box) | |
core.cljs:7889 Uncaught TypeError: me.cljs$core$IMapEntry$_val$arity$1 is not a function | |
What is @tags? | |
c…s.c…e.ValSeq {mseq: c…s.c…e.IndexedSeq, _meta: null, cljs$lang$protocol_mask$partition0$: 32374988, cljs$lang$protocol_mask$partition1$: 0} | |
_meta: null | |
cljs$lang$protocol_mask$partition0$: 32374988 | |
cljs$lang$protocol_mask$partition1$: 0 | |
mseq: | |
({:text "foo"}) | |
__proto__: cljs.core.ValSeq |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment