Redux
What is Redux?
Redux is a way to manage information in your app by keeping all your data in one central place. Instead of having information scattered throughout your app, Redux puts everything in one spot (called the store) that all parts of your app can check and update.
Simple Analogy
Think of Redux like a family calendar on the kitchen wall:
-
The Calendar (Store): One central place where all important information is kept. Everyone knows to check this calendar for updates.
-
Calendar Entries (State): The information written on the calendar, like appointments and events.
-
Writing on the Calendar (Actions): When someone wants to add or change something on the calendar, they write it down in a specific way.
-
Calendar Rules (Reducers): The rules for how to update the calendar. For example, if someone writes “Doctor appointment on Monday,” you know to add it to Monday’s section.
Key Concepts
- Store: The central place where all your app’s information is kept
- State: The information stored in your app
- Actions: Messages that describe what you want to change
- Reducers: Rules that explain how to update the information
- Dispatch: The way to send actions to update the information