Fork me on GitHub
#clojurescript
<
2019-10-08
>
nenadalm05:10:59

@antonmos If I remember well, I had this "Subprocess failed" issue on CI a few times when there was not enough RAM.

coder4633408:10:51

Hi! I'm trying out re-frame and I have a question: Whenever :db changes, I want to recalculate some fields that are also part of :db. What's the best way to do this?

Roman Liutikov08:10:24

You probably want to use subscriptions

coder4633408:10:56

Thank you for your help! I'll look into it

coder4633408:10:53

Hm, can a subscription have state or write back into the :db? I want to re-run expensive computations only when necessary.

Roman Liutikov08:10:19

No, but subscriptions memoize their results

Roman Liutikov08:10:49

it’s a good practice to keep derived state in subscriptions instead of app db

coder4633408:10:41

That's awesome, thank you for your help!

David Pham09:10:14

You can dispatch events in subscriptions if necessary.

David Pham09:10:28

(Bad behavior since you have side effects)

borkdude09:10:51

When the database changes, this the result of an event. You could update those fields in the same event or trigger a new event which updates those fields.

borkdude10:10:37

but derived values in a subscription is probably better for consistency

bfleischer12:10:05

Hi clojurians, I’m having an issue with this code, it’s printing a compile warning

Can't take value of macro cljs.core/or
and I’m not really sure why, could someone care to explain? Thanks

antonmos15:10:07

make sure that neither var-1 or var-2 are macros

antonmos15:10:21

i recently ran into this when i accidentally referenced a macro

bfleischer13:10:20

Those were strings lol . Ended up going around it and checking the boolean before in a let and it worked like a charm

thheller12:10:18

@bfleischer I assume you are using figwheel? there was a bug related to that, not sure if that has been fixed. might need to upgrade?

bfleischer12:10:30

Yep, figwheel-main

bfleischer12:10:41

Will check out the issues in the repo

thheller12:10:19

looks like it was fixed

bfleischer12:10:26

Oh you are faster

bfleischer12:10:02

Mm weird, we are working with the last version, will continue looking, thanks @thheller

Ramon Rios16:10:10

Hello gys. How do you configure a link in a view?