We are going to use the same code we created in the last recipe (Repository: /Chapter05/Recipe1/store) and add some modifications:
- First, we need to create new folders: src/actions, src/reducers, src/components/Coins, and src/shared/utils.
- The first file we need to create issrc/actions/actionTypes.js, where we need to add our constants for our actions:
export const FETCH_COINS_REQUEST = 'FETCH_COINS_REQUEST';export const FETCH_COINS_SUCCESS = 'FETCH_COINS_SUCCESS';export const FETCH_COINS_ERROR = 'FETCH_COINS_ERROR';
- Maybe you are wondering why we need to create a constant with the same name as the string. It is because, when using constants, we can't have duplicate constant names (we ...