You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
useSWRSubscription is helpful especially its deduping of multiple calls with the same key. One issue I am facing when trying to use it with supabase though is subscriptions are only called with new data (update, insert or delete) and not with all of the data like in Firebase.
I need to act on some prefetched data and either remove, add or update it to return the fully formed dataset. The only way I can think of to do this right now is combining useSWRSubscription with a useState like
I ideally would have a like useSWRReducer() that I can pass initial data into and then act on or something? I can probably make something similar for myself by using useReducer and useSWRSubscription + useEffect but I want to make sure I am not missing some intended way of using useSWRSubscription.
which seems kind of gnarly.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
-
useSWRSubscription is helpful especially its deduping of multiple calls with the same key. One issue I am facing when trying to use it with supabase though is subscriptions are only called with new data (update, insert or delete) and not with all of the data like in Firebase.
I need to act on some prefetched data and either remove, add or update it to return the fully formed dataset. The only way I can think of to do this right now is combining useSWRSubscription with a useState like
I ideally would have a like useSWRReducer() that I can pass initial data into and then act on or something? I can probably make something similar for myself by using useReducer and useSWRSubscription + useEffect but I want to make sure I am not missing some intended way of using useSWRSubscription.
which seems kind of gnarly.
Beta Was this translation helpful? Give feedback.
All reactions