Open bobular opened 4 months ago
I think we should just have usePromise
use useQuery
. We would have to include QueryClientProvider
in a more centralized place, such as https://github.com/VEuPathDB/web-monorepo/blob/main/packages/libs/wdk-client/src/Core/Root.tsx.
I think I have a plan to do this. It's related to the timeslider stepping forward/backward functionality we might still introduce (if the user has a floating plot active). Would appreciate feedback.
Overview
In all our
XxxVisualization
plugins, replacewith
where the return value is exactly the same as before (
{ value, error, pending }
);Implementation
useCachedPromise
would be implemented like this (not tested)Details
We may want to use
isFetching
instead ofisLoading
or a combination of it andisLoading
. Or maybestatus === 'loading'
. See here. We would need to look into the nitty-gritty ofreact-query
to make sure we get this right, and consider turning off background refetching? See below.QueryClientProvider
EDA will need this wrapped too (see packages/libs/eda/src/lib/map/MapVeuContainer.tsx) - at least the
VisualizationsContainer