ellers
Async Context and Store using route param
Thanks for the detailed answer!
Here's where I've got to, which works but I'm really not sure about the use of memo:
I've noted that the
Suspense
doesn't work - if I put an artificial delay in the async call, nothing displays at all. I can live with it, but I don't really understand it.
Thanks for your comments so far. Any additional insights, particularly about <Suspense>
and the memo would be great.13 replies
Async Context and Store using route param
Thanks for the repy @Madaxen86 !
Re tRPC, it's a good point that I may not need that. I'd used that on a previous project and carried it over.
But ... putting that to the side, if I say that the async query function is just a
setTimout
followed by returning hard-coded data, I can't figure out how to get the result of that into the context.
A key point is that the data is held in a store and then manipulated by functions provided in the context, so I'm not concerned with deduping queries here.13 replies