-
Notifications
You must be signed in to change notification settings - Fork 296
Remove FSA check in handleAction(s) #168
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
Conversation
12d5542
to
9da590b
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does there need to be a change in the README as well?
'The FSA spec mandates an action object with a type. Try using the createAction(s) method.' | ||
); | ||
|
||
if (!includes(actionTypes, action.type.toString())) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
const {type: actionType} = action
or
const {type} = action
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changed it.
We didn't made any changes when we added the check. The current README makes it pretty clear that |
9da590b
to
afb556f
Compare
} | ||
})).to.deep.equal({ | ||
counter: 0 | ||
}); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there a chai assertion that we expect this code block not to throw? I think that's the point, and not that the state is reduced to a certain value.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
http://chaijs.com/api/bdd/#method_throw
.not.to.throw
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This reducer should not throw AND just return the state. Will change that.
afb556f
to
ef4acb7
Compare
Please review again @yangmillstheory. |
Just have one last question: #168 (comment) |
Already answered and added :P |
Was this test failing before the application code changed? |
What do you mean exactly? |
If we removed the FSA check removal, then the test should fail (TDD) to eliminate false positives. Just wondering if that's the case |
The test I've wrote was failing when I've just removed the checks, because |
Great, thanks :) |
With #141 we have made other libraries incompatible with redux-actions and it resulted to an unexpected behavior (#164, #167). If an action is not a FSA, handleAction should not handle it and just pass it to the next reducer. This fix will remove the FSA check to support Non-FSA.
Closes #164, #167