concept action type in category react

This is an excerpt from Manning's book React in Action.
Although you may add more later in the chapter, you can start transitioning your Letters Social app to a Redux architecture by laying out some action types. These will usually map to user actions such as logging in, logging out, changing a form value, and so on, but they don’t necessarily have to be user actions. You may want to create action types for an opened, resolved, or errored network request or any other number of things that don’t directly pertain to a user.
It’s also worth noting that in a smaller app, you might not necessarily have to define your action types in a constants file; you could just as well remember to pass them in when you create actions or hardcode them yourself. The downside is that as your app grows, keeping track of action types will be a pain point and could lead to difficult debugging or refactoring situations. In most real-world cases, you’ll define your actions, so that’s what you’ll do here, too.
You’ll sketch out a few action types that you can expect to use, but you can feel free to add or remove them over time as needed. You’ll use the name-spacing approach to action types here, but remember when creating your own actions that you can follow whatever pattern you feel is best as long as they are unique. You’ll also “bundle” similar action types together in objects, but they could just as easily be spread out and exported as individual constants. The advantage to bundling is that you can group them together and use shorter names (GET, CREATE, and so on) without having to build those into the variable names themselves (UPDATE_USER_PROFILE, CREATE_NEW_POST, and so on). Listing 10.2 shows how to create your initial action types. You’ll put these in src/constants/types.js. You’re creating all the actions you’ll need for this chapter right now so you can reference them and don’t have to constantly go back to the file.
Listing 10.2. Defining action types (src/contstants/types.js)
export const app = { ERROR: 'letters-social/app/error', LOADED: 'letters-social/app/loaded', LOADING: 'letters-social/app/loading' }; export const auth = { LOGIN_SUCCESS: 'letters-social/auth/login/success', LOGOUT_SUCCESS: 'letters-social/auth/logout/success' }; export const posts = { CREATE: 'letters-social/post/create', GET: 'letters-social/post/get', LIKE: 'letters-social/post/like', NEXT: 'letters-social/post/paginate/next', UNLIKE: 'letters-social/post/unlike', UPDATE_LINKS: 'letters-social/post/paginate/update' }; export const comments = { CREATE: 'letters-social/comments/create', GET: 'letters-social/comments/get', SHOW: 'letters-social/comments/show', TOGGLE: 'letters-social/comments/toggle' };When using the Redux developer tools, these action types will show up in a timeline of your app’s state changes, so grouping names in a URL-like fashion like in listing 10.2 can make them easier to read when you have many actions and action types. You could also use : characters to separate them (namespace:action_name:status) or use whatever convention makes the most sense to you.