-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
actionCreator#toString didn't work on switch case #72
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
Comments
Unfortunately, JavaScript's semantics don't allow customizing how the switch (theAction.type) {
case action1.toString():
console.log(theAction.type)
break
default:
console.log('DEFAULT')
} A possible readability improvement could be to let switch (theAction.type) {
case action1.type:
console.log(theAction.type)
break
default:
console.log('DEFAULT')
} |
@markerikson Another benefit of adding a Arguably, this is an edge case though, and |
Yeah it's because I see the example here: 6da70cb#diff-5f580528e66e02eecffa3be1b7314c3aR31 I think you should update the example or add |
@agusputra : hmm. yeah, that one may be my fault for writing a bad example. |
Another solution: switch (theAction.type) {
case `${action1}`:
console.log(theAction.type)
break
default:
console.log('DEFAULT')
} |
Action creators now have a |
* Code Splitting docs * Add CSB Example * more info on code splitting Co-authored-by: Lenz Weber <[email protected]>
Generates void type when Request QueryArgs are empty.
Seems like there is still a problem with the endpoint ;-(
|
Those are matcher functions, not action creators. They do not have a You have to use the |
thank you for the explanation. |
It seems action creator cannot be used inside switch case.
case action1
didn't call toString()Sample code:
The text was updated successfully, but these errors were encountered: