1.0.42 - The parameters update
NO BREAKING CHANGES
CHANGES
- You can now use a custom storage in handle factories
// Create a storage in the hook or at top-level
const storage = XSWR.useAsyncLocalStorage()
const handle = XSWR.useSingle(
"/api/hello",
fetchAsJson,
{ storage })
XSWR.useFetch(handle)
return handle
- You can now use a custom key serializer in handle factories
const handle = XSWR.useSingle(
"/api/hello",
fetchAsJson,
{ serializer: GZIP })
XSWR.useFetch(handle)
return handle
- You can now use a custom equals function in handle factories
const handle = XSWR.useSingle(
"/api/hello",
fetchAsJson,
{ equals: deepCompare })
XSWR.useFetch(handle)
return handle