State

The full state object of our ToDo app consists of two keys: an array of todo items, and a string, which specifies the currently selected filter value. The initial state looks as follows:

{
"todos": [
{ "id": 1, "title": "Write React Hooks book", "completed": true },
{ "id": 2, "title": "Promote book", "completed": false }
],
"filter": "all"
}

As we can see, in Redux, the state object contains all of the state that is important to our app. In this case, the application state consists of an array of todos and a filter.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.117.196.184