Skip to content

1.0.42 - The parameters update

Compare
Choose a tag to compare
@hazae41 hazae41 released this 28 Aug 16:16
· 869 commits to master since this release

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