Replies: 1 comment
-
yes it is possible, there are concepts of adapters which you can use to cache the data, for example the library exports a export async function clientLoader(args: ClientLoaderFunctionArgs) {
// cache from the server loader
const server = await cacheClientLoader(args, {
type: 'swr',
})
// your code that is caching and fetching something on the client
const whiteboards = cache.getItem("whiteboards") ? cache.getItem("whiteboards") : await getAllLocalWhiteboards()
return {
...server,
whiteboards,
}
} |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
This is working great for server data - but in my usecase I am fetching data in the client loader that I also want to cache. Below is some rough code of what I'm trying to do - is this possible?
Beta Was this translation helpful? Give feedback.
All reactions