React

What is Redux and Its Most Asked Points in Short

What is Redux and Its Most Asked Points in Short

What is Redux? ⁣
⠀⠀⠀⠀⠀⠀⠀⠀⠀ ⁣
Redux is a JS library to manage our application state. ⁣ ⁣
👩🏼‍💻Can Redux replace React, Vue, or Angular? ⁣⠀⠀⠀⠀⠀⠀⠀ ⁣
No, Redux does not replace our current library or framework but complements it for better state management. ⁣
⠀⠀⠀⠀⠀⠀⠀⠀⠀ ⁣
👨🏼‍💻What are actions in Redux? ⁣
⠀⠀⠀⠀⠀⠀⠀⠀⠀ ⁣
Actions are the way we will interact with our data. Through our actions, we can dispatch a modification to our reducer based on user interaction with our web application. ⁣
⠀⠀⠀⠀⠀⠀⠀⠀⠀ ⁣
👨🏽‍🏫How do you dispatch an action? ⁣
We use a dispatcher to dispatch an action. Our dispatched action will have the action and the state that the reducer will handle. ⁣
⠀⠀⠀⠀⠀⠀⠀⠀⠀ ⁣
👩🏽‍💻What is a reducer? ⁣
⠀⠀⠀⠀⠀⠀⠀⠀⠀ ⁣
A reducer is a function that determines changes to an application's state, it makes a new copy of your data based on the action it receives. ⁣
⠀⠀⠀⠀⠀⠀⠀⠀⠀ ⁣
👩🏻‍🏫Where is the state being stored? ⁣
⠀⠀⠀⠀⠀⠀⠀⠀⠀ ⁣
A store holds the whole state tree of your application. The only way to change the state inside it is to dispatch an action on it. ⁣
⠀⠀⠀⠀⠀⠀⠀⠀⠀ ⁣
🤑Key selling points to use Redux? ⁣
⠀⠀⠀⠀⠀⠀⠀⠀⠀ ⁣
📌Single source of truth for application state. ⁣
📌The state is read-only which makes it less error-prone. ⁣
📌Easy to share state across your entire application. ⁣
📌Keeps historic data of how your state has changed which makes it easier for debugging. ⁣
⠀⠀⠀⠀⠀⠀⠀⠀⠀ ⁣
As you might have guessed I am a fanatic of Redux (when needed)! There's so much to learn about Redux but this is a good start. ⁣

Gigi Codes

Gigi | React Developer🔺 Mentor 🇻🇪 Venezolana📍San Francisco, Ca 👩🏼‍💻 Frontend Engineer @forethought.ai