Replies: 1 comment
-
Same (I think) Is it possible to add a custom cache provider to solve this? But between fetch and useSWR there should be a selector? Sure that works already somehow? I'm sure you have an advice for me, thanks in advance. Update: Just seen this post is 3 years old, probably I'm really missing the best practice to achieve: https://stackoverflow.com/questions/64554520/react-query-selectors Selectors 🥰 @wwan5803 any best practice found? Obviously I can implement it by myself, it just feels like workaround (aka using the wrong tool for my specific use case, where selectors are necessary and belong to SWR's jobs IMO Update: Looks promising, kinda what I wanted to avoid, manually change on fetch and then change back on mutate. Would be nice to add a generic approach (selector) that automatically involves "deselector" accordingly on mutate |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
I am migrating an redux project to use swr with struggling about where to do all the data manipulations(filter, normalise, select etc.) after fetching data from server. I can do it in custom hook or in component, however I find that both way is not elegant and efficient compared to what selector does in redux. Will anyone can give me some suggestions about this?
Beta Was this translation helpful? Give feedback.
All reactions