Fork me on GitHub
#reagent
<
2020-03-05
>
mikethompson08:03:32

@slawek098 We use re-frame with Hasura/Postgress and it is working out well. Hasura's subscriptions seem to be endlessly useful. We use Hasura's webhooks to callout to perform serverside logic (this logic can be in whatever language you want, including Clojure or Python or whatever) In fact, you can use an approach where saving a record in the database, triggers serverside code, which acts as someone of an effect handler.

mikethompson08:03:37

Hmm. I'm not sure I describing this well enough. Anyway, key takeaway is that Hasura might be a terrific addition to your architecture, if you use Postgres.

šŸ’Æ 4
mikethompson22:03:28

@U0626CD3J Yes, we use re-graph. i can't say I love it. It feels like the weakest part of the stack. So, I keep threatening to replace it with something better, but then a distraction happens. That's been happening for a year.

xhh03:03:48

šŸ˜† Thanks for sharing your experiences.

Felipe Marques17:03:21

hi, I'm trying to understand if it is ok to have reagent-components with multi-arity, but didn't found any info on that šŸ˜ž

aisamu18:03:52

It is, AFAICT

āž• 4
mikerod20:03:20

I have a case where one of my components is not updating. Using a basic re-frame subscription. The value in it is clearly changing and the reaction is firing.

mikerod20:03:31

But one of the dependency component trees just is ignored.

mikerod20:03:59

One of the first Iā€™ve seen of this doing nothing special. Standard render fn form-1. No closure situation etc.

mikerod20:03:47

Sort of hard to troubleshoot. Thinking Iā€™ll try to look some at the queue stuff in reagent and dig around. I canā€™t reproduce it in a small example unfortunately. I probably could if I knew the cause, but thatā€™s the problem! Hah.

mikerod20:03:38

It initially renders and uses the value too. Itā€™s just a value change doesnā€™t trigger. If I do something else to affect the component tree it then does update.

mikerod20:03:11

Wonder if there are outstanding issues that could possibly relate.

mikerod20:03:23

Iā€™ll dig. Was searching for like ā€œre-renderā€ as the term.

lilactown20:03:26

Iā€™ve seen similar behavior when a reagent component is called as a function, rather than in hiccup

lilactown20:03:42

not sure if that helps your investigation

mikerod20:03:25

Iā€™m using hiccup for sure. I did look closely for that

mikerod20:03:47

And I know I gave no solid details. Hah. I appreciate that input. It certainly has been a problem Iā€™ve seen people have before.

manutter5120:03:39

This is the most common bug symptom I see with React-based components. I usually fix it by manually putting a key on the component and making sure the key changes whenever the value changes, like this

^{:key (str "my-widget-" value)}
[my-component {:value value}]

mikerod18:03:46

@U06CM8C3V thanks for the tip - I overlooked it yesterday - Iā€™ll experiment with this

šŸ‘ 4
manutter5120:03:39

The tricky part is sometimes itā€™s the element itself that responds to the key, and sometimes itā€™s a parent component. But once you get it right it stays fixed.

šŸ‘ 8