Skip to content

Instantly share code, notes, and snippets.

@bpicolo
Last active March 15, 2016 03:48
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 bpicolo/4de274cc4c6f49cc72d1 to your computer and use it in GitHub Desktop.
Save bpicolo/4de274cc4c6f49cc72d1 to your computer and use it in GitHub Desktop.
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