Fork me on GitHub
#reagent
<
2017-07-02
>
fabrao03:07:44

Hello all. I was studing how to use http://cljsjs.github.io/ in reagent project, but I couldn´t figure out. Is there the same as you use .js included in html and using the lib as js/<library export>?

stuartrexking09:07:16

What does the symbol “:>” refer to?

daiyi10:07:13

heya! I'm just starting with svg in reagent; is there a better way to draw paths than with a huge string e.g. [:path {:d "M 30,40 C 100,40 50,110 120,110"}]? it's awfully cumbersome to compose that string 😞

stuartrexking11:07:19

Thanks. I figured it out. Is this something that should /will be in the docs?

pesterhazy11:07:28

it definitely should

pesterhazy11:07:20

I've created a "wishlist" issue to write an actual user's manual for reagent

stuartrexking11:07:33

Ah, thank you very much both @kennethkalmer and @peterhazy

pesterhazy11:07:36

but haven't worked on it because I'm lazy

stuartrexking11:07:59

It’s a good list though.

mikethompson14:07:38

@daiyi yeah, I'm afraid that's all you have when using SVG paths.

yury.solovyov15:07:42

ok, I didn't found class-names, so I've written my own FWIW -> https://github.com/YurySolovyov/class-names-cljs

pesterhazy16:07:38

I mean, the one you didn't find

yury.solovyov16:07:06

well, that one is for JS

yury.solovyov16:07:53

@pesterhazy I didn't want to have to cast maps to objects or use special syntax

yury.solovyov16:07:08

to interoperate

pesterhazy16:07:47

I understand the rationale, I was just checking that that's what you're referring to

yury.solovyov16:07:17

yes, correct, my was inspired by this one

pesterhazy16:07:38

it would be cool if reagent supported than natively

pesterhazy16:07:02

[:div {:class ["foo" "bar" :baz]}]

pesterhazy16:07:04

something like that

yury.solovyov16:07:21

I'm happy to upstream it if that's ok with reagent guys

pesterhazy16:07:12

IMO it wouldn't hurt to add your function, or something like it, to reagent.core

pesterhazy16:07:36

or even to add a special check for the class prop - though maybe that's a bit too much magic?

yury.solovyov16:07:27

I'll fill the issue

pesterhazy16:07:53

I mean we already support [:div.foo {:class "bar"}] so the additional check for (seq? class) may not be too much trouble: https://github.com/reagent-project/reagent/blob/master/test/reagenttest/testreagent.cljs#L301

ajs20:07:59

with reagent reactions and/or re-frame subscriptions, is it smart enough to know that if another component already queried a subscription on the current render frame, it will not re-run the subscription/reaction again? i.e. does it sort of internally memoize reactions/subscriptions?