Q1. What is Redux?
Redux is a predictable state container for JavaScript apps, often used with React. It helps manage global state in a single store, with actions and reducers to update state in a predictable way.
Q2. What are the core principles of Redux?
Single source of truth (one store), state is read-only (only changed by actions), and changes are made by pure functions called reducers.
Q3. What is a store in Redux?
The store holds the entire state tree of the application. It allows access to state via getState(), updates via dispatch(action), and registration of listeners via subscribe().
Q4. What are actions and reducers?
Actions are plain objects that describe what happened (e.g., { type: 'ADD_TODO', payload: 'Learn Redux' }). Reducers are pure functions that take the current state and an action, and return a new state.
Q5. Why use Redux with React?
Redux centralizes state management, making it easier to debug and test. It also helps manage complex state interactions and provides middleware for async logic.
