InterviewSolution
Saved Bookmarks
| 1. |
Show using code how constants can be used in Redux. |
|
Answer» First of all, we can store all the constants in a single file in our project NAMED constants.js or SOMETHING else as follows: export const ADDING_TODO = 'ADDING_TODO';export const DELETING_TODO = 'DELETING_TODO';export const EDITING_TODO = 'EDITING_TODO';export const COMPLETING_TODO = 'COMPLETING_TODO';export const COMPLETING_ALL = 'COMPLETING_ALL';export const CLEARING_COMPLETED = 'CLEARING_COMPLETED';After storing the constants in one place, we can use them in two ways in our project:
|
|