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

Actions with the same export name will be overwritten #10

Closed
lhz516 opened this issue Jul 30, 2016 · 2 comments
Closed

Actions with the same export name will be overwritten #10

lhz516 opened this issue Jul 30, 2016 · 2 comments

Comments

@lhz516
Copy link

lhz516 commented Jul 30, 2016

For example, I have a projects action in core module for following/commenting projects, I also have a projects action in admin module for adding/editing projects

However, if I export these actions with same name from two different modules, one of them will be overwritten. Probably the better way is to merge them, not to overwrite one of them.

If this is considered as a bug, I can submit a PR to fix it.

@HaareeKrishna
Copy link

HaareeKrishna commented Aug 5, 2016

@lhz516 Modules should be independent of each other so as action methods.

We need to have module namespacing for these methods while exporting them, so that we will eliminate overwriting existing action method from other module.
May be like this:

import action from admin.js; const admin = { action }; export default admin;

and access as

actions.admin.action, actions.project.action

@lhz516
Copy link
Author

lhz516 commented Aug 11, 2016

@HaareeKrishna Okay, that makes sense. TY

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