A common convention when using Redux is to store actions in their own file as
export const USER_AUTH_ATTEMPT = 'USER_AUTH_ATTEMPT';
export const USER_AUTH_CHECK = 'USER_AUTH_CHECK';
export const USER_AUTH_FAIL = 'USER_AUTH_FAIL';
export const USER_AUTH_SUCCESS = 'USER_AUTH_SUCCESS';
export const USER_AUTH_LOGOUT = 'USER_AUTH_LOGOUT';
export const USER_AUTH_ATTEMPT = 0;
export const USER_AUTH_CHECK = 1;
export const USER_AUTH_FAIL = 2;
export const USER_AUTH_SUCCESS = 3;
export const USER_AUTH_LOGOUT = 4;
In the redux architecture, actions are dispatched to a store, not a single reducer. So you can have multiple reducers that react to the same action. This is also why you have a
default: return state-like branch in your switch statements inside reducers.
If you do this, you have to be completely sure no two actions have the same number ID, which is harder than with strings.
The other important reason is debugging, for example with redux-logger (it would print numbers instead of helpful, descriptive action names).
Edit: Qianyue's answer gives another excellent reason not to do it.