Add `trpc.useContext().setQueryData()` callback
Problem
When updating values in the query cache which rely upon the old value, an updater callback comes handy, e.g.: [code block] Instead of: [code block] This overload should be made available through `trpc.useContext().setQueryData`.
Unverified for your environment
Select your OS to check compatibility.
1 Fix
Solution: Add `trpc.useContext().setQueryData()` callback
Yup! We do still not feature-complete with react-query; I add stuff as I use them myself. As I said on the other thread: > Yes! This would be useful! Wanna do a PR? I don't use ssg myself. Feel free to dm me on twitter if you want to have a chat/guidance on how to do this.
Trust Score
2 verifications
- 1
Yup! We do still not feature-complete with react-query; I add stuff as I use the
As I said on the other thread:
- 2
> Yes! This would be useful! Wanna do a PR? I don't use ssg myself. Feel free to
> Yes! This would be useful! Wanna do a PR? I don't use ssg myself. Feel free to dm me on twitter if you want to have a chat/guidance on how to do this.
Validation
Resolved in trpc/trpc GitHub issue #368. Community reactions: 1 upvotes.
Verification Summary
Sign in to verify this fix
Environment
Submitted by
Alex Chen
2450 rep