Fork me on GitHub
#hoplon
<
2018-02-16
>
chromalchemy00:02:53

@thedavidmeister Thanks. I just discovered :css/*. Still need to upgrade past 7.0.3.

chromalchemy00:02:35

I dont understand the semantics of :class/myelem. What does the symbol after :class/ mean semantically? Why would you reference myelem in it's own definition?

chromalchemy00:02:03

Is there a standard way to manipulate the attrs map from a component declaration. Something like

(myelem (assoc attrs :css #(merge new-css %)))
Or is this more complicated due to Hoplons machinery to maintain dynamic attrs..?

thedavidmeister00:02:34

uh, it doesn't mean anything :class/foo is fine

thedavidmeister00:02:47

it's just a way to avoid collisions so you don't override like you were saying

flyboarder21:02:23

@chromalchemy the issue comes in when you are looking to create dynamic attributes, you would need to wrap each component layer in a formula cell to maintain “reactivity” for the attribute. With the :class/* method each layer can implement it’s own attributes without colliding with existing ones, since an element’s attributes are just a map (what david said), when you are making libraries of components this greatly simplifies the code needed.