How would I implement a newsfeed like this in terms of cache invalidation? #7689
Unanswered
ishaanbuildsthings
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
I'm building a React Native app with a newsfeed. I understand how mutations work and how to use useInfiniteScroll. My question is more of a design one.
Currently, I have a basic hook
useNewsfeed
that returns a list of all relevant post data, including data such as the post author and if we follow them.From the newsfeed screen, if a user clicks on a post author to enter their profile, then follows them, we can use a mutation and optimistic UI to update the following-status on that screen. But when the user backs out of the profile screen and goes back to the newsfeed, we would need to update the post in the newsfeed to show we are following them now.
How can I structure my queries and caching to generally support this type of behavior? It seems like a very difficult task to precisely know what to invalidate and it doesn't help all of my newsfeed elements exist in just one cache value.
Beta Was this translation helpful? Give feedback.
All reactions