Closed
Description
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 }
Metadata
Metadata
Assignees
Labels
No labels