Invalidate all routes #2567
-
Is there a way to invalidate all routes? My app is multitenant, when I change the tenant "activeTenant" in user data updates and session token refreshes. Then I navigate to root path. const changeActiveTenant = useMutation({
mutationFn: async (data: Pick<SelectTenant, "id">) => {
return await context.proxy.auth.changeActiveTenant.mutate(data);
},
onSuccess: async () => {
router.invalidate();
router.navigate({ to: "/hub" });
},
onError: (err) => {
toast.error(err.message);
},
}); This method only invalidates the current path that it is called, so this causes showing the old tenant data for a second before new data loads with Edit: |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 2 replies
-
You are looking for a way to empty all cached matches. |
Beta Was this translation helpful? Give feedback.
You are looking for a way to empty all cached matches.
we don't have this yet, but this could be added