Steps for Implementing Redux Into a Project
Step 1: Install Redux & react-redux, and redux-thunk npm install redux npm install react-redux npm install redux-thunk Step 2: Think about what states you want your store to have For my case, it was: 1 2 3 4 5 { streams: [{},{}] trades: [{},{}] globalNominalDenom: 'SGD' } Step 3: Taking stock of ways Database data and store data is interacted with There are three broad functions you’re trying to achieve, what I call, the right hand, left hand, and the reducers. Right hand is in charge of getting state from database. Left hand is in charge of ‘pushing’ state to store via dispatch. With the help of redux-thunk, you essentially combine these two functions together into the definition of action creators. ...