Fork me on GitHub
#reagent
<
2018-11-27
>
urzds18:11:11

Hi! Is there a shortcut for (into [...] (for [x xs] [f x]))? f being a function and reagent component.

urzds18:11:19

Before I tried [... (for ...)], which is a bit shorter and quicker to understand, but that creates problems with reagent complaining about a missing :key, probably because the seq will end up literally in the vector.

justinlee18:11:00

there’s no built in shortcut, but if you’re doing this often you can make a quick function to do it for you

justinlee18:11:17

(and yes, that’s why it complained about the missing key)

urzds18:11:41

Originally I had [... (map f xs)], which was as concise as it gets, but that's not using reagent.

justinlee18:11:41

yea you want to end up with a vector rather than applying the render func directly