Skip to content

Support initialState for createStore #52

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

Merged
merged 2 commits into from
Jan 10, 2016

Conversation

D34THWINGS
Copy link
Contributor

The original redux createStore function allows to pass an initial state, but nothing allows us to so with ng-redux

Thanks, for your work

@wbuchwalter wbuchwalter self-assigned this Jan 8, 2016
@wbuchwalter
Copy link
Member

Hey Benjamin,

Thanks for the PR, this is needed indeed.
This currently doesn't work though since initialState is passed as parameter of createStoreWith but used in another function $get, so they are not in the same scope, that will trigger an undefined error.

You need to create a private variable _initialState and use it like the _middleware variable for example.

Also if initialState is not provided, we should fall back to {}.

If you don't have time to do that, let me know and I'll finish this.

Thanks again

@D34THWINGS
Copy link
Contributor Author

@wbuchwalter Done !

@wbuchwalter
Copy link
Member

Thanks a lot! 👍

wbuchwalter added a commit that referenced this pull request Jan 10, 2016
Support initialState for createStore
@wbuchwalter wbuchwalter merged commit c2ea2ac into angular-redux:master Jan 10, 2016
@wbuchwalter wbuchwalter mentioned this pull request Jan 10, 2016
@wbuchwalter
Copy link
Member

Released @3.2.0.

@D34THWINGS
Copy link
Contributor Author

Perfect ! Thanks ! 👍

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