Skip to content

Initial store state #30

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

Closed
jacobrask opened this issue Oct 15, 2015 · 2 comments
Closed

Initial store state #30

jacobrask opened this issue Oct 15, 2015 · 2 comments

Comments

@jacobrask
Copy link

Hi, the Redux method to create a store is createStore(reducer, [initialState]). Is there a way in ng-redux to supply an initial state to the created store? Otherwise you can't seed the application from the server or localStorage.

I guess this relates to #19 a bit.

@wbuchwalter
Copy link
Member

Hey Jacob,
Yea it's somewhat related, ideally ngRedux wouldn't handle the store creation at all, but this proved tricky with injectable middlewares.
That said, for your specific issue, a paramater could be added to createStoreWith in last position that would take the initialState and then passed to Redux's createStore.
I don't see any problem doing that.
I'll try to do that in the next few days, but feel free to make a PR if you need it before that!
Thanks

@wbuchwalter
Copy link
Member

Fixed (At last) via #52.
Thanks @D34THWINGS

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

No branches or pull requests

2 participants