Skip to main content

Session 10: REDUX & MORE ...

๐Ÿ”น Basic Reduxโ€‹

1. Theoryโ€‹

https://redux.js.org/introduction/getting-started

2. Usage with Reactโ€‹

https://react-redux.js.org

3. Diagramโ€‹

https://kuanhsuh.github.io/2017/09/28/What-s-Redux-and-how-to-use-it/

4. Install packages: redux, react-reduxโ€‹

npm install --save redux
npm isntall --save react-redux
npm isntall --save --dev redux-devtools-extension

5. Coding:โ€‹

  • actions / types.js (constants)
  • actions / index.js
  • reducers / index.js
  • components
  • root reducers (store.js)
  • store (store.js)
  • App.js (config Provider with store)

6. Debug:โ€‹

  • Download tool: add react redux tool (chrome)

๐Ÿ”น Additional Reduxโ€‹

7. Redux Thunkโ€‹

  • Install: npm install --save redux-thunk
  • Actions: PENDING, SUCCESS, ERROR
  • Async Action (axios / fetch)
  • Config middleware (store.js)

8. Redux Toolkitโ€‹

https://redux-toolkit.js.org/introduction/getting-started

9. Redux Saga (Read more)โ€‹