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

New pbundle option "packReduxData" for SSR redux state #1532

Merged
merged 4 commits into from
Feb 15, 2020

Conversation

christianlent
Copy link
Contributor

No description provided.

@jchip
Copy link
Member

jchip commented Feb 13, 2020

it should be better to do this in realizeReduxStore

@jchip
Copy link
Member

jchip commented Feb 14, 2020

also probably should do something related to this

if (subAppServer.attachInitialState !== false) {

  • do that if no packReduxData exist
  • packReduxData part should check attachInitialState flag

// then stringify packReduxData's return value and attach it to the index html.
if (packReduxData && subAppServer.attachInitialState !== false) {
this.initialStateStr = JSON.stringify(packReduxData(this.store));
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this should be done outside of the if, because a store may have been realized already.

Also, only do this if this.initialStateStr is falsy

@jchip jchip merged commit 35eca3b into electrode-io:master Feb 15, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants