feat: simplify caching — TanStack Query as single source of truth (#6075)

This commit is contained in:
Thomas authored and GitHub committed 2026-07-03 16:33:03 +02:00
1 parent a5ec880eec
commit f19033e0d5
187 files changed
+1013 -4712

No files matched your search

+1 -10
View File
@@ -19,16 +19,7 @@ export default function WeatherWidget({ isEditMode, options }: WidgetComponentPr
latitude: options.location.latitude,
longitude: options.location.longitude,
};
const { data: weather } = clientApi.widget.weather.atLocation.useQuery(input, {
staleTime: 60 * 1000,
refetchOnWindowFocus: false,
refetchOnReconnect: false,
});
const utils = clientApi.useUtils();
clientApi.widget.weather.subscribeAtLocation.useSubscription(input, {
onData: (data) => utils.widget.weather.atLocation.setData(input, data),
});
const { data: weather } = clientApi.widget.weather.atLocation.useQuery(input);
if (!weather) return <WidgetEmptyState />;