Shu Ding

Results 403 comments of Shu Ding

Thanks! Yeah we still have a couple of concerns: - Should we leverage the new React useSyncExternalStore (useMutableSource) API? - In subscription mode, many of the SWR configs will be...

Thank you for updating this! To push this forward, we need to set some minimal requirements to get this stable (under a flag or prefixed with unstable_). Here’re my thoughts:...

Hi, thanks for writing the description carefully! This is definitely something we need to refine in the future. However, currently you can use this to serialize array/object keys and then...

Also could you elaborate more on the "category" idea? Is it similar to scopped/namespaced cache? Not sure if I'm following.

Hi! For `useSWRInfinite`, you need to use ```js import { unstable_serialize } from 'swr/infinite' ``` And then ```js fallback: { [unstable_serialize(getKey)]: [initialPageData] } ``` > Sending undefined is not possible...

Sorry that I missed your previous comment @macsikora. The reason that SWR doesn’t encourage writing to the cache is because that can be dangerous. Writing to the cache is a...

@Antonio-Laguna Not related, I was answering the question regarding writing to the cache verses serving as fallback.

We now have docs for cases like this now: https://swr.vercel.app/docs/with-nextjs#complex-keys It’s marked as unstable because the API (wrapping with `[]` and then call a serialize function) is still not ideal,...

@Antonio-Laguna With this approach, the extra request can be avoided if you have `revalidateIfStale: false`: ```js function App({ data }) { return ( new Map(Object.entries(data)) }}> ) } ``` By...

How about using the `.url` value as the key? ```js useSWR(supabase.from("table").select("*").eq("id", 1).url, supabaseFetcher); ```