T
TanStack2mo ago
extended-salmon

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
extended-salmon
extended-salmonOP2mo ago
I was using it for request-level caching.
unwilling-turquoise
unwilling-turquoise2mo ago
what do need to cache here? where do write to it?
extended-salmon
extended-salmonOP2mo 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.
unwilling-turquoise
unwilling-turquoise2mo ago
we might add something similar again

Did you find this page helpful?