Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

Migrating the Remaining Reducers from Context API to Redux Toolkit #131

Open
1 task
Tingg-v1 opened this issue Jun 7, 2024 · 0 comments
Open
1 task
Labels
enhancement New feature or request

Comments

@Tingg-v1
Copy link
Contributor

Tingg-v1 commented Jun 7, 2024

Problem

The existing frontend codebase is partially migrated from the Context API to Redux Toolkit. While the appview, menu, and query components have been successfully migrated, the remaining components including DatabaseReducers, ERDReducers, and related actions, still use the Context API. This partial migration creates inconsistency in state management, making the codebase harder to maintain and scale.

Solution

  1. Create slice file for DatabaseReducers and ERDReducers
  2. Define the Initial State and Reducers by moving the logic from DatabaseActions.ts, ERDMySqlActions.ts, ERDPsqlActions.ts, and ERDSqLiteActions.ts into the slices.
  3. Add the slices to the store configuration in store.ts.
  4. For each component using DatabaseActions and ERDActions, update to use useSelector and useDispatch.
  5. Remove the old related actions, contexts and reducers

Additional information

No response

👨‍👧‍👦 Contributing

  • 🙋‍♂️ Yes, I'd love to make a PR to implement this feature!
@Tingg-v1 Tingg-v1 added the enhancement New feature or request label Jun 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant