Fork me on GitHub
#fulcro
<
2020-06-11
>
bbss05:06:10

@tony.kay wow, the video's on reducers and hooks are what I've been wondering about for a long time. Since I like hooks a lot I wanted to ask "how about a use-query hook?" but didn't want to impose something that costs a lot of work on you. It's very useful to see how to go about extending fulcro with it. Very informative to see a couple of approaches! Thanks.

mruzekw06:06:53

See use-query-subscription

mruzekw06:06:20

And use-child-sales

bbss06:06:30

@mruzekw thanks! use-query-subscription was exactly what was shown in the video 🙂

mruzekw06:06:50

Oh, right haha

bbss06:06:55

might look into using workspaces as well.. Not sure if it'll be worth it. Do you use it?

mruzekw06:06:16

I haven't used it much. Can't vouch for it either way

bbss06:06:21

used defcards a while back, I can see the use for it when you have a complicated UI that is composed in a lot of different ways. Always found the "shows environmental coupling" feature interesting.

bbss06:06:09

will do :thumbsup:

coetry17:06:23

Hey friends, if I wanted to generate a completely static html export of my app. Is there a way to do this in Fulcro? I'm going for something along the lines of what's provided by Next.js or Gatsby.

holyjak18:06:07

Hello! What is the right way to load data into the root of the DB? I have this component, loading a list of deals (having a pathom resolver from :deals to a list of things):

(defsc HotDeals [this {:keys [deals]}]
  {:query [{[:deals '_] (comp/get-query Deal)}]
   :componentDidMount (fn [this] (df/load! this :deals this))}
  ...)
I think this is wrong as it will load {:deals [...]} from Pathom and place it under :deals in the DB so that I end up with {:deals {:deals [..]}} , no? How to correct it? Thank you!

holyjak19:06:25

Hm, perhaps I should have instead used (df/load! this :deals Deal) which will send the correct query to Pathom and store it as expected....

👍 1