Hi all,

I'm new to reagent, and do not seem to understand it well enough for the 
following.

My problem: how do I write description lists. In all the examples I've 
seen, there were only simple lists, returning a single <li> element.

For a description list, I need to return two sibling elements, <dt> and 
<dd>. Other examples returning more than one element used a workaround: 
just put a <div> around your elements, but that's (bad html and) not 
possible in this situation.

I tried this and it seems to work 

(defn programm-für-kino
  [programm]
  (into [:dl.filmprogramm-für-kino]
        (apply concat (for [termin programm]
                        [[:dt [:a {:href (:full_url termin) :target "_blank"
}
                               (:title termin)] ]
                         [:dd (:date termin)]]))))


but, since I have nested <dl> elements, I tried this and it failed, 
returning the component as object (I guess) and some data from my maps???

(defn kino-mit-programm [kino]
  (let [programm (<sub [::subs/programm-für-kino (:k_id kino)])]
    [ [:dt (:title kino)
     [:dd [programm-für-kino programm]]]))

(defn kino-liste []
  (let [kinos (<sub [::subs/aktive-kinos])]
    [:div (when kinos
            (into [:dl.kinos-mit-programm]
                  (apply concat (for [kino kinos]
                                  [kino-mit-programm kino]))))]))


If I change the component in the last line into a function call it works 
again...???

(for [kino kinos] (kino-mit-programm kino))

So this works if I return the list of [:dt] [:dd] inside a component, but 
if I try it with a component it bombs?

I think this shows that I do not understand when and how the component 
creation works here...

Can someone explain to me what might be going on?

Thanks, Mathias






-- 
You received this message because you are subscribed to the Google Groups 
"Reagent-Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to reagent-project+unsubscr...@googlegroups.com.
To post to this group, send email to reagent-project@googlegroups.com.
Visit this group at https://groups.google.com/group/reagent-project.
For more options, visit https://groups.google.com/d/optout.

Reply via email to