SNICKER
SNICKER
TTCTheo's Typesafe Cult
Created by Sz on 12/12/2023 in #questions
Adding Custom Headers in trpc using local storage
Hey can you please share that cde snippet ?
4 replies
TTCTheo's Typesafe Cult
Created by NoName Nomad on 10/26/2023 in #questions
Average Interview Rates for Developer?
I am a fresher and looking for a job currently , any tips for me 🥲
12 replies
TTCTheo's Typesafe Cult
Created by gsemyong on 10/21/2023 in #questions
Caching and invalidation in t3-stack with app router and trpc
In my t3 app with app router when I invalidate a api call it makes my page refresh , this is happening only in dev and not in production 😅 .Any idea ? This is the link to the code repo : https://github.com/sohan9819/devloop
const createPost = api.post.create.useMutation({
onSuccess: () => {
router.refresh();
setTitle("");
setContent("");
void utils.post.getAll.invalidate(); // Invalidating
},
});
const createPost = api.post.create.useMutation({
onSuccess: () => {
router.refresh();
setTitle("");
setContent("");
void utils.post.getAll.invalidate(); // Invalidating
},
});
In this I am revalidating the post.getAll whenever a new post is created and it refreshes the entire app when a new post is created.
9 replies