Skip to content

Default initial state #69

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
Elijen opened this issue Feb 19, 2016 · 3 comments
Closed

Default initial state #69

Elijen opened this issue Feb 19, 2016 · 3 comments
Assignees

Comments

@Elijen
Copy link

Elijen commented Feb 19, 2016

Creating a store like this $ngReduxProvider.createStoreWith(myReducer); causes the reducers receive arguments like this:

{ 
   state: {}, 
   action: {type: "@@redux/INIT"}
}

This prevents the reducer from returning initial state on the first run like this:

if (typeof state === 'undefined') {
   return initialState
}

Reducer should be called instead with the following arguments:

{ 
   state: undefined, 
   action: {type: "@@redux/INIT"}
}
@Elijen
Copy link
Author

Elijen commented Feb 19, 2016

Looks like dist is outdated in 3.3.0 and does not include the fix from #55. Using master solved the problem.

@Elijen Elijen closed this as completed Feb 19, 2016
@wbuchwalter
Copy link
Member

Thanks for the info, reopening as a reminder to myself to look into that.

@wbuchwalter
Copy link
Member

dist has been updated, let me know if I missed something.
Thanks.

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