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

issue-2158/Refactored redux store utility functions #2482

Open
wants to merge 6 commits into
base: main
Choose a base branch
from

Conversation

KraftKatten
Copy link
Collaborator

@KraftKatten KraftKatten commented Jan 19, 2025

Description

This PR is a start of refactoring Redux store utility functions. It creates utility methods such as create, load, loaded, update, updated and deleted for the remoteData data type. So far, the refactoring applies only to the following features:

  • AreaAssignment
  • Areas
  • JoinForms
  • Tags

Next step is to get this code reviewed and approved, and then I'll continue refactoring for other features as well.

Screenshots

Only code changes.

Changes

  • Adds utility methods for common Redux store operations
  • Refactors AreaAssignment, Areas, JoinForms and Tags
  • Adds tests

Notes to reviewer

Related issues

The issue won't be completely resolved by this PR.

},
tagCreate: (state) => {
state.tagList.isLoading;
},
tagCreated: (state, action: PayloadAction<ZetkinTag>) => {
const tag = action.payload;
state.tagList.isLoading = false;
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't be removed, will fix

@@ -75,10 +70,7 @@ const tagsSlice = createSlice({
},
tagGroupCreated: (state, action: PayloadAction<ZetkinTagGroup>) => {
const tagGroup = action.payload;
state.tagGroupList.isLoading = false;
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't be removed, will fix

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

Successfully merging this pull request may close these issues.

1 participant