Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Refactor: Transition from Context API to Reducers #254

Open
wants to merge 28 commits into
base: lesson-1
Choose a base branch
from

Conversation

sayyidmarvanvt
Copy link

This pull request introduces a significant refactor of the state management approach in the application. The following changes have been made:

  1. New File Added:

    • utils/reducer/reducer.utils.js: This file contains utility functions to manage state updates using reducers.
  2. Updated Context Files:

    • user.context.js: Refactored to utilize the reducer pattern for managing user authentication state.
    • categories.context.js: Updated to use reducers for handling category-related state.
    • cart.context.js: Changed to employ a reducer for cart state management, allowing for better scalability and maintainability.
  3. Purpose of Changes:

  • Improve the scalability of the state management logic.
  • Enhance code readability and maintainability by utilizing the reducer pattern.
  • Prepare the codebase for future features that may require more complex state management.

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants