-
Notifications
You must be signed in to change notification settings - Fork 76
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
Improve defining action types #93
Comments
+1 The intent of
This could be a cool feature. |
I prefer option 1, mainly because you can then do cool stuff like this: var UserActionCreators = new ActionCreators({
types: {
addUser: Constants.ADD_USER
}
}); And have Marty automatically create the addUser method for you (with it auto dispatching). I think it also looks much cleaner and will be easier for people to understand. Trying to get across that 'you have to return an instance of a constant' is not going to be easy. |
In Marty v0.9 |
Our current approach to defining action types has a number of drawbacks:
{ foo() { }
)updateCriteria: SomeConstants.UPDATE_CRITERIA(function (profileId, criteria) { ...
)Function annotations solve this problem perfectly. Unfortunately it won't be in any spec anytime soon. So we need an alternative approach.
The two contenders right now:
Have a type hash
Invoke constant inside of creator
The text was updated successfully, but these errors were encountered: