Fork me on GitHub
#rum
<
2021-04-26
>
sova-soars-the-sora14:04:54

Hi, I'm wondering how to use rum/local and also pass parameters to my components

sova-soars-the-sora14:04:13

does state always need to be the first param? And if so, how can I pass my own parameters

sova-soars-the-sora14:04:23

Ah, forgot about defcs

👍 2
sova-soars-the-sora17:04:19

I have a basic prototype working. It basically mounts a sentence with flippable vocabulary elements to a dom div.

sova-soars-the-sora17:04:48

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.

sova-soars-the-sora17:04:26

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?

sova-soars-the-sora17:04:31

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?

sova-soars-the-sora17:04:42

I think update-in?

sova-soars-the-sora17:04:21

I think I have it roughly figured out now. ^.^