Fork me on GitHub
#untangled
<
2017-06-06
>
adamvh22:06:13

how do i do get a df/load-data post-mutation to do a follow-on read?

adamvh22:06:10

my post-mutation touches a bunch of stuff in the app-state that i'd like to trigger re-renders for, but since the :post-mutation parameter just takes a mutation symbol instead of a query expression i'm not sure how to tell the reconciler what keywords i'm dirtying

adamvh22:06:20

so, i notice that the solutions in the "putting it together" portion of the dev-guide actually behave the same way - on page refresh, they don't show the data loaded from the server until you trigger a render through the text field's :onChange - i guess this is why df/load is the preferred method?

tony.kay23:06:30

@claudiu It should be a no-op on the server-side.

tony.kay23:06:25

@adamvh So, load-data allows for a general query, but once I identified the real needs it was less useful (see the white-board YouTube video): https://youtu.be/mT4jJHf929Q?list=PLVi9lDx-4C_T_gsmBQ_2gztvk6h_Usw6R

tony.kay23:06:27

load has a :refresh option that can be given the additional keywords to re-render,

adamvh23:06:54

but if i use load i basically have to send the server my root component's (or some component's) entire query, righty?

tony.kay23:06:37

you should always be using defui to write your queries, or you don’t get normalization…even with load-data

tony.kay23:06:45

even if the defui doesn’t have a render

tony.kay23:06:21

watch the video…it will clear a lot up

tony.kay23:06:01

it’s too easy to get lost in the weeds of syntax until you understand how to think about the database and loading

adamvh23:06:31

ah, this is not the whiteboard video i have seen before - ok, i'll have a gander

adamvh23:06:10

as it stands what i'm having trouble getting past is a perceived super-tight coupling between what my ui data looks like and what i'm sending to the server

tony.kay23:06:16

short answer: (load :questions Question) means “load something using the made-up root keyword :questions that are of type Question.

adamvh23:06:36

but i won't bug you anymore until i watch the video

tony.kay23:06:41

but those questions then get linked into the UI by post mutations etc

tony.kay23:06:46

yeah, the video will help

tony.kay23:06:46

That coupling has to be solved (or you have a nightmare of chasing irrelevant threads of UI tree)…Untangled solves it, but you have to think about it from the ident/normalization standpoint. The video should clear it up.

tony.kay23:06:27

You also want to use InitialAppState to ensure you don’t have to hand-construct (and correct when you refactor) the UI-only tree at app startup.