Fork me on GitHub
#fulcro
<
2020-03-09
>
Jakub Holý (HolyJak)18:03:07

I have a page with many components showing various data. I want to show the page as soon as some "core" data is loaded while data for the other components is still being loaded in parallel (ie. component X does not need to wait for component Y). What is the Fulcro way to implement it? I could follow http://book.fulcrologic.com/#IncrementalLoading and :without the secondary data but how do I load this additional data? Should each of the components load-field! inside :componentWillMount ?

tony.kay19:03:57

@holyjak I’d use post mutations for that I think

tony.kay19:03:19

issue your initial loads in app start, and have your app’s root use some kind of top-level flag to prevent rendering

tony.kay19:03:34

Then the post mutation can change the flag to render, and issue the additional loads

tony.kay19:03:55

load-field! is just a convenience that focuses the query. Just look at its implementation. There are utilities like focus-query that can be used to create the properly-pruned query

👍 4
Jakub Holý (HolyJak)19:03:06

@tony.kay I see the docstring of defmutation doesn't really describe ok-action , error-action , and the content of env. Shouldn't it? I can write it based on http://book.fulcrologic.com/#_the_sections and send a PR...

tony.kay19:03:25

no, because that is configurable. It is described in default-result-action

tony.kay19:03:57

could add a “See default-result-action!

👍 4
Jakub Holý (HolyJak)21:03:50

Where is the RAD book? Or is it now integrated into the normal book? I am especially interested in reports...

tony.kay21:03:54

reports are not remotely done or really even fully designed. Sorry 🙂

😿 8
tony.kay21:03:16

working hard, at the moment, to make forms more feature complete.

👍 12