Tuesday, December 31, 2019

Basic Todo App using Redux:



The redux package can be installed using react redux.
Actions are sent via Reducers to modify the state store.
Now to connect the redux to the React app, this is done through ui components.
There are two type of Components.

1. Presentational components 
2. Containers are components connected to the redux

Now a store needs to be created and then hook it up with the App. To hook with the app,
Provider can be used. App can be embedded in provider tag and

Depending on the application, we can have multiple reducers. For e.g. for todo app, the state that app manages
Are mainly the list of todos, visibilityFilter. For each reducer, create separate files for each reduce
Since each of the reducers are in different file, the index.js can mix it up in a file which is index.js 
There is a combined reducer function which can accept multiple reducer names. The combined reducer is given as store to the
Application.

Below is architecture for Redux pattern 

References
https://www.youtube.com/watch?v=pyfPG7erRxI


No comments:

Post a Comment