Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How best to seed store with data from server side? #182

Closed
schutterp opened this issue Jan 8, 2015 · 3 comments
Closed

How best to seed store with data from server side? #182

schutterp opened this issue Jan 8, 2015 · 3 comments
Labels

Comments

@schutterp
Copy link

I have isomorphic react components that render serverside, but I haven't found a 'good' way to seed the stores in the browser with the state provided from the server.

In my app's initialization method on the client I am directly passing the state data to what should be a private update method on the store before rendering my react components. Is there a best practice for accomplishing this?

@influx6
Copy link

influx6 commented Jan 9, 2015

You can create a stateData manager for each group of react components or create a global one, these will handle providing state data to the stores. And allows easy change and maintainability

@gpbl
Copy link

gpbl commented Jan 9, 2015

I'm using express-state on the server and a store mixin to rehydrate data in the store's state.

@schutterp
Copy link
Author

Thanks for the replies!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants