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

Split up reducers #490

Merged
merged 8 commits into from
Apr 20, 2024
Merged

Split up reducers #490

merged 8 commits into from
Apr 20, 2024

Conversation

legnes
Copy link
Contributor

@legnes legnes commented Apr 20, 2024

This PR splits the giant reducer file into three separate reducers: one for the grid state, one for the builder, and one for the puzzle. It also moves some of the reducer logic into little util files to avoid circularities (which I don't think would break the build or anything, but just to be on the safe side...).

To make the diff easier to read, I copied the old reducer file over to new reducer files and then edited each one down in its own commit (this was @mdirolf's idea).

I think the split-up reducer files should have a few advantages

  • More manageable
  • Makes it clearer how the different parts of the state are interconnected
  • Prerequisite for any kind of future refactoring of the reducer logic or introduction of a state management library

@mdirolf mdirolf merged commit 04acdb0 into crosshare-org:master Apr 20, 2024
1 check passed
@mdirolf
Copy link
Member

mdirolf commented Apr 20, 2024

I think this is a huge improvement - thanks for putting in all the effort on it!

@legnes legnes deleted the refactor-reducer branch April 21, 2024 00:25
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.

2 participants