Skip to content

Improve redux types #1122

@mattrunyon

Description

@mattrunyon

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)

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions