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

Make constants functions #39

Closed
jhollingworth opened this issue Dec 16, 2014 · 1 comment
Closed

Make constants functions #39

jhollingworth opened this issue Dec 16, 2014 · 1 comment

Comments

@jhollingworth
Copy link
Contributor

Want to support a more succinct way of defining constants for action creators

Marty.createActionCreator({
   createUser: Constants.CREATE_USER(function (user) {
      this.dispatch(user);  
   })
})

Constants are actually functions

function CREATE_USER(creator) {
   creator.type = "CREATE_USER";
   return creator;
}

CREATE_USER.toString = function () {
   return "CREATE_USER";
}
@jhollingworth
Copy link
Contributor Author

Fixed in #45

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

1 participant