Fork me on GitHub
#clojure-europe
<
2020-11-20
>
dharrigan09:11:15

Good Morning!

thomas11:11:47

ok, n00b question... I have a reagent app and I want to do an HTTP call when I load my component... But when I do it in the render call it doesn't really work... so how do I make an http call (in normal react it would componentDidMount or something like that... but what is the equivalent in Reagent?

borkdude11:11:17

:component-did-mount :)

borkdude11:11:31

See the docs for r/create-class

thomas11:11:58

aah so I create a class with a didmount func and a render func?

borkdude11:11:02

so yes, but you didn't spell those keys right

thomas11:11:23

I know... just trying to type on a Friday afternoon. and thank you!

👍 3
otfrom11:11:51

so this change did the lion's share of work in making my 1hour single threaded code take 4 minutes on a 16 core machine: https://github.com/MastodonC/witan.send/blob/30d009a3b12009b1ae05bf8debfbcfc7622b9aa4/src/clj/witan/send/model/run.clj#L198-L226

otfrom11:11:55

pretty pleased with it

👍 15
otfrom11:11:50

I just wish I had the time to stream the results down to the various things making data products as I could keep the memory pressure massively down too. atm I'm realising the whole sequence

otfrom11:11:31

the code in the into and the let do the same thing

otfrom12:11:25

(this kind of change is why I keep on pushing at it)

dominicm18:11:58

That's awesome.

dominicm18:11:19

I wonder what you'd do with a 5950 in your hands...

otfrom19:11:22

I'm running it on an Intel nuc 16 core Xeon with 64gb ram atm. That box looks good.

otfrom21:11:42

just ran it on my 4 core 16GB xps 13 (a few generations old) and it ran in 12 minutes with 12GB Xmx on Java 1.8 (I was running 1.11 on the NUC). So I'm pretty happy with that too. 🙂

otfrom21:11:05

I like that it runs a lot faster and that being able to throw more cores and RAM at it makes a difference