re-frame

https://github.com/Day8/re-frame/blob/master/docs/README.md https://github.com/Day8/re-frame/blob/master/docs/External-Resources.md
2021-05-31T04:00:51.055Z

In the doc, it was mentioned that: the query function triggers the view function, see https://day8.github.io/re-frame/dominoes-30k/#3-4-5-6-summary. However, it seems to me, it is indeed the view function triggers the query function. The query function does not know what to query without the params specified by the view function.

p-himik 2021-05-31T07:43:42.055200Z

The documentation is correct. The exact quote, emphasis is mine: > triggers query functions to rerun The first deref in a view causes the query function (aka subscription handler) to run. Any subsequent state change (barring subscription input signals for simplicity) causes the query function to re-run. And that causes the view function to re-run. That's not specific to re-frame in any way - that's just how Reagent works with its reactions. The app-db is just a ratom, a subscription is just a reaction.

2021-05-31T12:56:42.055500Z

Thanks for the answer. Could you point me to some docs on WHY (instead of how) reaction could auto update the value when the tracked ratom changes?

p-himik 2021-05-31T13:00:12.055700Z

I'm not sure if explaining "why X can do Y" is possible in general without also explaining the "how" part. :) Otherwise it will be just "because it was designed to do so". In any case, I'm not aware of such a doc. Maybe there's something useful in Reagent documentation.

p-himik 2021-05-31T07:43:42.055200Z

The documentation is correct. The exact quote, emphasis is mine: > triggers query functions to rerun The first deref in a view causes the query function (aka subscription handler) to run. Any subsequent state change (barring subscription input signals for simplicity) causes the query function to re-run. And that causes the view function to re-run. That's not specific to re-frame in any way - that's just how Reagent works with its reactions. The app-db is just a ratom, a subscription is just a reaction.

2021-05-31T12:56:42.055500Z

Thanks for the answer. Could you point me to some docs on WHY (instead of how) reaction could auto update the value when the tracked ratom changes?

p-himik 2021-05-31T13:00:12.055700Z

I'm not sure if explaining "why X can do Y" is possible in general without also explaining the "how" part. :) Otherwise it will be just "because it was designed to do so". In any case, I'm not aware of such a doc. Maybe there's something useful in Reagent documentation.