Hi, I'm wondering how to use rum/local and also pass parameters to my components
does state
always need to be the first param? And if so, how can I pass my own parameters
Ah, forgot about defcs
I have a basic prototype working. It basically mounts a sentence with flippable vocabulary elements to a dom div.
Now, I want to make multiple sentences. Which means I need multiple dom divs. I can programmatically generate div ids and programmatically generate the javascript calls, too.
However, I am not sure how to store the div ids for mounting. I am thinking something like a map where the keys are the div-ids and the values are a vector of the elements to mount. And then maybe I can doseq
or for
over the map keys and mount mount mount?
The datastructure looks like
{"div1" [{:e "E" :x "X"} {:e "F" :x "Y"} {:e "G" :x "Z"}]
"div2" [...]
"div3" [...]}
How can I
(swap! m ...)
to stuff more maps into the vector?I think update-in?
I think I have it roughly figured out now. ^.^