Clojurians
#hoplon
<
2015-10-06
>

This page is not created by, affiliated with, or supported by Slack Technologies, Inc.

mynomoto11:10:10

@levitanong: the version passing a string always append. You can do :class (cell= {:some-constant-class-name true :work work? :play ?play})

mynomoto11:10:44

In this case if ?work is thruty the element will have the class work, and if it's false it won't. This will work. Or better yet: :class (cell= {:some-constant-class-name true :work work? :play (not ?work)})

levitanong12:10:05

Hmm. That doesn’t seem to scale to, say, 100 possible states. Then again, at that point, one could use (merge)

mynomoto13:10:23

@levitanong: 100 possible states are too many states :wink: You can also create a do! method that deals with class in any way you want.

levitanong13:10:43

@mynomoto: Well, that’s a good point. :stuck_out_tongue:

micha16:10:56

@jab: thanks for making that :simple_smile:

jab17:10:53

@micha: my pleasure and glad if it's useful!

jab17:10:33

https://www.youtube.com/watch?v=i3Xack9ufYk possibly of interest @alandipert @micha et al