Slide 15
Slide 15 text
Comparison Between REDUX and REDUX TOOLKIT
Photo by Pexels
1. Boilerplate Code
- Redux: Writing Redux code from scratch often involves creating action types, action
creators, and separate reducer functions, leading to A LOT OF boilerplate code.
- Redux Toolkit: Redux Toolkit significantly reduces boilerplate code by introducing APIs
like `createSlice` and `createAsyncThunk`, which automate the creation of actions and
reducers, making the codebase more concise and easier to maintain.
2. Complexity
- Redux: Vanilla Redux can be complex, especially for developers new to the library, due to
its various concepts like actions, reducers, middleware, and the store.
- Redux Toolkit: Redux Toolkit simplifies the structure and usage of Redux by providing a
more opinionated approach. It combines actions and reducers into "slices," making it
easier to grasp the relationships between different parts of the application.