Does SolidStart Have a Global `Context` That Server Functions Can Use?
Other SSR frameworks have a concept of a "
context
" that is globally available to all server functions. For instance, Svelte Kit has event.locals
(https://kit.svelte.dev/docs/load#shared-state), which can be set at the server entry point (hooks.server.ts
). This context info is then available to all of the server data loaders.
Similarly, Remix passes a context
argument to its loader
and actions
. The value of context
can be set by getLoadContext
(https://remix.run/docs/en/v1/route/loader#context).
Does SolidStart have anything similar? Or are there at least plans to add something like this in the future? Having a global context is really helpful when it comes to user identifiers.3 Replies
Unknown User•2y ago
Message Not Public
Sign In & Join Server To View
different api from the question
Ah, I forgot to close this out. Yes, I opened an issue on the Solid Start repo sometime after opening this question. It seems we have
event.locals
now. Thanks @zihan