T
TanStack17h ago
ratty-blush

Replacement for `import { getContext, setContext } from '@tanstack/react-start/server'` in RC?

GitHub
router/packages/start-server-core/src/h3.ts at v1.131.27 · TanStac...
🤖 Fully typesafe Router for React (and friends) w/ built-in caching, 1st class search-param APIs, client-side cache integration and isomorphic rendering. - TanStack/router
4 Replies
ratty-blush
ratty-blushOP17h ago
I was using it for request-level caching.
genetic-orange
genetic-orange16h ago
what do need to cache here? where do write to it?
ratty-blush
ratty-blushOP16h ago
I write to it from a server-side function. Imagine a "getUserSession" function that is cached using server context. Other server functions can then call getUserSession without worrying about refetching multiple times per request. Same applies for anything else that does not change during a request but may be invoked multiple times.
genetic-orange
genetic-orange11h ago
we might add something similar again

Did you find this page helpful?