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

fix assertReducerShape #2408

Closed
wants to merge 1 commit into from
Closed

fix assertReducerShape #2408

wants to merge 1 commit into from

Conversation

jeno5980515
Copy link

Hi, I remove the part that you check the private namespace is used or not.

I think the code is no use for the condition.
If the namespace is used, the reducer should return a initial state instead of undefined.
Otherwise if it really return undefined it should block at the previous error.
Only check is undefined or not is not working for check the private namespace is used or not.

I think it should check the initial state and the state return from the reducer which give private namespace action are deep different or not.
However it will reduce lot's performance I think.

Thanks!

@timdorr
Copy link
Member

timdorr commented May 16, 2017

This was added in #259 to fix #186. This is correct as-is and should not be removed.

@timdorr timdorr closed this May 16, 2017
@jeno5980515
Copy link
Author

jeno5980515 commented May 17, 2017

I had read the reference you give.
However, I think the check code still not throw any error if I give a reducer with handle the action with @@redux/INIT or @@INIT.
By the way if the reducer return undefined, it should throw error at the
initialState === 'undefined'
not at
typeof reducer(undefined, { type }) === 'undefined'

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