redux-api-middleware: not working when browser not support Symbol

if browser not support Symbol ,the action.key is string not equal to object , so push error and not send api

for (let key in action) {
    if (key !== [CALL_API]) {
      validationErrors.push(`Invalid root key: ${key}`);
    }
  }

I fount if browser support Symbol , do not enter this for loop . because action.key is real Symbol

Maybe this validate is not necessary .

About this issue

  • Original URL
  • State: closed
  • Created 9 years ago
  • Comments: 28 (7 by maintainers)

Commits related to this issue

Most upvoted comments

Lol, I feel bad for putting a symbol there in the first place in the real-world example. 😄

+1 I’m having this issue in IE11. I added es6-symbol and verified that I can create and use Symbols, but I still can’t get [CALL_API] to work in IE.

I just published v1.0.2 and v2.0.0-beta.1 to npm.

PR #43 is the best solution, and soon wil be in the next branch for v2.0.0-beta.

@agraboso

i found the Discussion about use Symbol as action type.

https://github.com/rackt/redux/pull/114#issuecomment-112608830 https://github.com/rackt/redux/pull/127

and @gaearon change Symbol to prefix @@ as initial action special type in redux. so how about change Symbol('Call API') to redux-api-middleware/API or @@redux-api-middleware/API or something else.

You could inject a polyfill for Symbol into your project. See: https://github.com/zloirock/core-js#commonjs