Fork me on GitHub
#reagent
<
2017-11-04
>
Pontus07:11:14

I'm getting this warning: "Reactive deref not supported in lazy seq, it should be wrapped in doall" even though I'm always using a (into [:div ... ) when I use e.g, map. into also forces evaluation, doesn't it? So why the warning?

noisesmith14:11:25

map never forces evaluation, if you use into the result can't be a lazy-seq so you can't get that error, but map islazy

Pontus15:11:07

I'm getting it here: https://github.com/pcolliander/api-test/blob/master/src/cljs/api-test/components/sidebar.cljs#L46 and it goes away if I wrap it in (doall ) - I just don't understand why I have to wrap it in doall when into already forces evaluation.

noisesmith15:11:42

the map isn't pulled into the [], it's just nested inside it

noisesmith15:11:07

(into [(map f coll)]) - the map isn't forced, it's just a lazy item inside an eager one

noisesmith15:11:19

perhaps you meant to do (into [] (map f coll))

noisesmith15:11:43

or equivalent (but better performance) (into [] (map f) coll)

Pontus15:11:30

Ahh I see, thanks for the help!

ajs04:11:58

Why is the transducer version faster?

noisesmith07:11:32

it avoids creating a temporary collection that nobody needs to consume

ajs10:11:14

I don't know transducers that well, but don't they create their own state?

noisesmith15:11:53

they are allowed to, the map transducer doesn't, because it doesn't need to

pwrflx09:11:58

Hi! how do you do testing with Clojurescript? What I'd like to achieve is to spin up a jetty with some clojurescript code in it, and run my webdriver tests against it. For a regular application I've done this, but not sure how to do it for each reagent component separately (the testcases would test the components in this case, not the whole app)

reefersleep18:11:48

Maybe use devcards to display your components?

pwrflx19:11:50

@reefersleep no experience with it, but will take a glance, thanks!

reefersleep22:11:49

Btw, my personal experience with Selenium is that it is slow and unreliable, so I urge everyone to stay away from it. Don't know if that is what you're using.

reefersleep22:11:19

I'd rather test my components manually. Don't know if other people have had success with programmatically testing reagent components.