Closed
Description
openedon Mar 5, 2022
Currently createEntityAdapter
provides no type checking for the id of an entity
This prevents type checking when using the selectors, and means that the return type of functions such as getAllIds
returns EntityId[]
rather than a type specific to the entity.
Introducing an (optional) type parameter for Id will solve all of these propblems, and also allow for the newtype pattern to ensure types between different adapters do not get mixed up
type MyIdType = string & { readonly __tag: unique symbol }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Metadata
Assignees
Labels
No labels