Fork me on GitHub
#clojurescript
<
2019-05-30
>
stathissideris14:05:39

I have this code (when (or enabled spec) (or spec name)) and I get a compile warning via figwheel-main that says: Can't take value of macro cljs.core/or pointing to that line.

stathissideris14:05:08

Afaik, this is valid clojure(script)

dpsutton14:05:28

i think there's a fixed bug in figwheel. You can downgrade your clojurescript to a 4xx version i think or bump figwheel-main to [com.bhauman/figwheel-main "0.2.1-SNAPSHOT"]

stathissideris14:05:44

both sound like undesirable options, I have refactored it to:

(when enabled
                    (when spec
                      (or spec name)))

stathissideris15:05:18

…which is not the equivalent 😄

dpsutton15:05:18

macroexpand it and use the resulting form?

ghadi15:05:52

(when spec (or spec name)) has an unreachable branch (getting to name)

vnctaing21:05:03

What library does the community tend to use for managing form state, with reagent ?

nenadalm12:06:34

Hi. Here's the thread on clojureverse about it: https://clojureverse.org/t/form-handling-in-re-frame-in-2018/3140. I am not sure if any of them handles validation though - I usually have it right before submit. There was also nice talk on Clojure/north about how some people do it (they didn't publish any code though - so you would have to take the ideas and implement yours): https://www.youtube.com/watch?v=IekPZpfbdaI&amp;amp=

💚 4
RafaMedina22:05:09

re-frame @vnctaing could be an option, or a r/atom for internal component state I think

vnctaing22:05:24

But is there a library built for a re-frame architecture that comes with features like validation, dirty/pristine detection, normalizing, etc… I would have the feeling of recreating the wheel, by creating events, effects for my forms from scratch, no ?

RafaMedina22:05:08

I have the same question too hahaha

lilactown23:05:12

I've heard of some libraries, which probably appear on google, but I don't know of any "community standard"