router
                                
                                 router copied to clipboard
                                
                                    router copied to clipboard
                            
                            
                            
                        Exposing a way to delete all match cache
Context: #250
First of all, this is one of my first times I've ever contributed code to a project like this, I'm a WIP developer very much in a beginner level, so please excuse me if this is a trivial or wrong thing to work on, or if I didn't do it right. It's just 3 lines of code that would help the project I'm working on right now.
Usage:
const router = useRouter();
if (!isLoggedIn) {
  router.removeAllCache();
}
Or:
const router = useRouter();
const loagoutHandler = (event: React.MouseEvent<HTMLButtonElement>) => {
  event.preventDefault();
  authCtx.logout();
  router.removeAllCache();
}
Or something similar.
Thanks.
@Angelelz is attempting to deploy a commit to the Tanstack Team on Vercel.
A member of the Team first needs to authorize it.
Is this something the Author is not interested in? Any thoughts or comment? Is there any plan to implement any other way to destroy the preloaded data? Thanks,
Next version will have this as a first class api.
TanStack Router now has router.clearMatchCache()