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

Give the initial action a special type #127

Merged
merged 1 commit into from Jun 17, 2015
Merged

Give the initial action a special type #127

merged 1 commit into from Jun 17, 2015

Conversation

gaearon
Copy link
Contributor

@gaearon gaearon commented Jun 17, 2015

Supersedes #114.

I want to establish a convention for “built-in” and “devtools” action types (more will come in #113) so that the tools are able to distinguish them, and so the user doesn't feel compelled to handle them and can clearly see that they are not from their app.

Thanks to @ooflorent for the @@ naming tip.

@@ -1,8 +1,12 @@
import composeMiddleware from './utils/composeMiddleware';

const INIT_ACTION = {
type: '@@INIT'
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Camelcase would be sexier (example on MDN)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was actually kinda torn on this one. :-)
Action types are all caps by convention.

I'd rather keep @@ as the marker of “special stuff” and keep using all caps for action types and camel for state keys:

export const StateKeys = {
  LOG: '@@log'
};

export const ActionTypes = {
  JUMP_TO_STATE: '@@JUMP_TO_STATE'
};

gaearon added a commit that referenced this pull request Jun 17, 2015
Give the initial action a special type
@gaearon gaearon merged commit dbe1a17 into master Jun 17, 2015
@gaearon gaearon deleted the give-it-a-type branch June 17, 2015 14:42
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

Successfully merging this pull request may close these issues.

None yet

2 participants