Now let’s add some starter code for the redux store.
src/external/redux/constants.js file create three constants
The meaning of each constant must be the same as its name.
src/external/redux/actions.js file, you need to create and export the action creator
This function must return an object with two fields:
type field must be the
payload must be the action creator argument.
In the same file, add the
addListResult method, which will be the first argument to receive the state of the application, and the second - payload from the
This method should return an updated state. Only the
LISTS property should be updated.
addListResult must add a new object with the
key field equal to the second argument of
The second field of this object must be
createAt, equal to the result of calling
Use this method for the
reducer in the
src/external/reducer/store file for the
The default storage should have 4 properties -
WORDS - empty arrays,
src/external/reducer/store file, do not forget to export by default the creation of a store with the connected middleware
If you have any issues with it, you can ask for community help below the post.
Feel free to help others if you’ve already solved the task.