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

devtools-one-store cleanup #3

Merged
merged 2 commits into from
Dec 13, 2022

Conversation

cwstra
Copy link

@cwstra cwstra commented Dec 4, 2022

Notable design changes to pavlobu's code:

  • The original implementation kept the information for each tracked connection in separate maps; here, I've unified them
  • Due to the above change, I also put the connection information into a small discriminated union, so Typescript can keep track of which case we're in.
  • The original added a store property to each sub state, which seemed redundant, considering they're already keyed off of the store string. I removed it.

@pavlobu
Copy link
Owner

pavlobu commented Dec 10, 2022

thanks, great job

Although I feel like we are having too many logic in one function, and it is really hard to unit test and maintain this.

It's not your or mine problem, the code was already written in this unmaintainable way without covering all edge cases with unit tests.

I think we need to apply some design patterns for the current devtoolsImpl function and split the code into smaller much easier to unit test pieces. That's seems to be like a long journey

@pavlobu pavlobu merged commit b259934 into pavlobu:devtools-one-store Dec 13, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants