-
Notifications
You must be signed in to change notification settings - Fork 27k
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
is it possible to create a global var that's shared between pages? #203
Comments
|
Isn't this what props are for? |
See the redux example |
btw, this wouldn't work on client, when the value was mutated. |
The Redux example is an example with one page. I think the initial question is if it's able to switch between different pages while keeping a global persistent state. I don't think that's possible yet, but may be possible after #25 |
@CompuIves, @malixsys is right, the Redux example shows how to keep state across page changes, through the IMHO a better central management of state is needed, as these issues keep popping up. |
something like a registry API might be appropriate for this e.g.
|
Essentially looking for a way to get around the code splitting to store application wide settings. Will try extending the window object but would much prefer a server backed solution instead |
You can do all the server-side you want, although a bit difficult at this moment until #25 |
Just to clarify:
|
@eezing sure,
Like @malixsys mentioned though, I can leverage the getInitialProps here and be just fine until #25 however it could be interesting to expose access to globals from the client as well, but that might be another can of worms |
No description provided.
The text was updated successfully, but these errors were encountered: