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

Server state, client state and component state of redux? How does it work? #65

Closed
rperrote opened this issue Jan 10, 2018 · 2 comments
Closed
Assignees

Comments

@rperrote
Copy link

Reviewing the project I can see 3 definitions of the state of redux.. I assign different initialState in the 3 places and deploy the app:

  1. for few secons i can see a server initial state
  2. then the state changes for the client version of initial state
  3. I never see the initial state of the component

How does it work?

I need it to work offline. That the user can add the app to his home and when he opens the app he sees his state cached and that it is validated with the one he has in the server and is updated on both sides. (merge status)

PD: Sorry for my bad english translate with google :P

Best regards, Rodrigo Perrote.

@tirthbodawala
Copy link
Member

@rperrote. Well as its SSR supported application we need initial state in server.js and client.js. No other file needs to be updated.

src/client.js

export const reduxInitialState = {};

src/server.js

app.use((req, res, next) => {
  res.locals.reduxInitialState = {};
  next();
});

I need to understand your exact requirement how you need to sync it with the server and work with the offline state. Can you please explain more?

@tirthbodawala
Copy link
Member

Closing due to no-reply.

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

No branches or pull requests

2 participants