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

Improve redux types #1122

Closed
mattrunyon opened this issue Mar 1, 2023 · 0 comments · Fixed by #1056
Closed

Improve redux types #1122

mattrunyon opened this issue Mar 1, 2023 · 0 comments · Fixed by #1056
Assignees
Labels
enhancement New feature or request

Comments

@mattrunyon
Copy link
Collaborator

mattrunyon commented Mar 1, 2023

We should probably be using generics more in redux so that DHE types get properly inferred when they differ from DHC.

One example is getSettings which the store from DHE has extra settings. Most selectors should probably be something in the form of getSettings<S extends CommunityStore>(store: S): S['settings'] or something like that. Then as long as the DHE store extends the DHC store, we should get the proper DHE types for DHE specific selectors

Or even something like getSettings<S>(store: { settings: S }): S => store.settings since that's really the minimum required for the selector. This might play nicer w/ a few mismatches between DHC and DHE (like ServerConfigValues currently)

@mattrunyon mattrunyon added enhancement New feature or request triage Issue requires triage labels Mar 1, 2023
@vbabich vbabich removed the triage Issue requires triage label Mar 8, 2023
Zhou-Ziheng added a commit that referenced this issue Mar 13, 2023
- Fixes #1122
- Improved certain types
BREAKING CHANGE: Selector Type removed from redux
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

Successfully merging a pull request may close this issue.

3 participants