Store creation and location in effector-solid and Solid Start
This may be part solid part effector question but would like to ask here because of Solid Start and the SSR setup it provides. This may be actually more generally applicable to any store or data kept outside of the tree.
Is there some constraints to where/when external data should be kept or initialized when using Solid Start with SSR.
I guess this is relevant also to any SSR and have found Effector specific solutions to that (https://effector.dev/docs/api/effector/fork/) but wondering if anyone knows of any specific considerations that should be taken into account for Solid.
Currently just have the separate ts files next to component just for stores and events to be used by components.
4 Replies
I'm not too sure what
effector
does but generally you should be wary and/or avoid global stores during SSR because all instances of the state are shared with all requests. The recommended solution is to use the Context apiokay nice thanks, yea effector has the fork api to separate scope so it doesnt leek between requests. Do you know how Context Api avoid that or is it just done differently that its not even a problem there?
It's done differently as far as I know. Context is unique to each request i believe
Alright cool, thanks