Redux (1/6)
What is Redux, and why might you use it with React?
    Redux is a state management library for JavaScript applications, often used with React. It provides a predictable state container and helps manage the state of an application in a centralized manner. Redux is particularly useful for large and complex applications where the state needs to be shared and updated across multiple components.
    TRedux use cases:
    • Large-scale applications with complex state structures. Such as applications with multiple components that need access to a shared state.
    • You have large amounts of application state that are needed in many places in the app
    • The app state is updated frequently and the logic to update that state is quite complex
    • Applications that need time-travel debugging and state history requirements.
    • The app has a medium or large-sized codebase and might be worked on by many people
    Advantages:
    • Centralised state management improves predictability and debugging.
    • Unidirectional data flow.
    • Supports middleware for asynchronous actions, such as Redux Thunk or Redux Saga.
    • Provides dev tools, and middleware for enhanced development and debugging.
    • The patterns and tools provided by Redux make it easier to understand when, where, why, and how the state of our application is being updated, and how our application logic will behave when those changes occur.
    • Redux makes our code predictable and testable, which helps give you confidence that your application will work as expected.
    Disadvantages:
    • Can introduce boilerplate code for setup and actions.
    • The learning curve for beginners is due to its concepts like reducers, actions, and stores.