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

Simplify return logic in handleActions; remove typeof check #106

Merged
merged 1 commit into from
Jul 10, 2016
Merged

Simplify return logic in handleActions; remove typeof check #106

merged 1 commit into from
Jul 10, 2016

Conversation

yangmillstheory
Copy link
Contributor

http://stackoverflow.com/a/4725697/2419669

For undeclared variables, typeof foo will return the string literal "undefined", whereas the identity check foo === undefined would trigger the error "foo is not defined".

For local variables (which you know are declared somewhere), no such error would occur, hence the identity check.

defaultState is declared as a parameter, so the typeof check is unnecessary (like here).

@timche timche merged commit 1dc2449 into redux-utilities:master Jul 10, 2016
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.

None yet

2 participants