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

Can't use ES6 classes for actions #136

Open
bensgroi opened this issue May 26, 2017 · 2 comments
Open

Can't use ES6 classes for actions #136

bensgroi opened this issue May 26, 2017 · 2 comments

Comments

@bensgroi
Copy link

bensgroi commented May 26, 2017

The project I'm working on is written in ES6 and transpiled with babel. I can use classes for components just fine, but when attempting to use classes for actions and supply them to $ngRedux.connect, I get the following error: "'mapStateToScope' must return an object or a function. Instead received %s."

The check in question is here: https://github.com/angular-redux/ng-redux/blob/master/src/components/connector.js#L84 Specifically the lodash isPlainObject seems to be the problem. It seems like using isObject would make more sense here, and would allow transpiled ES6 classes as well.

I can submit a PR if you'd like.

@bensgroi bensgroi changed the title Can't use ES6 classes for action functions Can't use ES6 classes for actions May 26, 2017
@bensgroi
Copy link
Author

I'll try putting together a plunker or other demo.

@AntJanus
Copy link
Collaborator

@bensgroi if you can submit a PR, that'd be great! I'm guessing this works correctly in plain redux?

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

No branches or pull requests

2 participants