1.0.51 - The schema memo update
BREAKING CHANGES
- New syntax for
XSWR.use
:XSWR.use(schema)
=>XSWR.use(factory, deps)
function getCatShema(id: string) {
return XSWR.single(["/api/cat", id], fetchAsJson)
}
function useCatBase(id: string) {
return XSWR.use(getCatSchema, [id])
}
It works like useMemo
but the deps are passed to the factory.