-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Add type parameter for Id in createEntityAdapter #2098
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
Comments
Hmm. @phryneas , thoughts? |
Any updates on this - I should have time to make some changes to the pr this weekend if you decide this is something you want |
Sorry, I have my wedding party coming up on saturday and don't really have the mental capacity to get deeper into this before that. |
Just thought I would drop another message to see what the status was with this - I'm happy to give more details of my use case if it would be helpful |
I'll have time this friday. |
Available in the 2.0 betas. |
Currently
createEntityAdapter
provides no type checking for the id of an entityThis prevents type checking when using the selectors, and means that the return type of functions such as
getAllIds
returnsEntityId[]
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
The text was updated successfully, but these errors were encountered: