josh.deltener's avatar

How does Vuex work with with Server Side Rendering or Nuxt? (assuming node env)

I have what I think it a pretty NOOB question. How does Vuex function within SSR? I believe it’s just a js obj client side (with boat loads of setter/getter boilerplate), but how does it behave server side?

(assuming node env) Is it just something in server memory? I assume it’s lost when the instance is rebooted? Do other concurrent users share the same instance, if so, how do you shard it?

0 likes
1 reply
josh.deltener's avatar

LOL, sad.. It's been 3 years and still no reply. Well Josh, I'm here to change all that! You see Vuex initializes server side once per hit, so nobody shares the same instance. There are ways to pre-fill that instance with data, but you don't have to worry about cross-state problems (unless you use an object instead of a function in your state) :P

Please or to participate in this conversation.