RFC(@ngrx/signals): Add type of id as optional second type arg to withEntities<Entity,Id>()
#4570
Open
1 of 2 tasks
withEntities<Entity,Id>()
#4570
Which @ngrx/* package(s) are relevant/related to the feature request?
signals
Information
The
withEntities
feature usesEntityId
for the entities' id, which is defined asexport type EntityId = string | number
.We have a use case where we need to narrow down the type of the id to (e.g.)
UUID
(or some other sub-type ofstring
).So I'd suggest adding a second optional type arg to
withEntities()
like this:Describe any alternatives/workarounds you're currently using
At the moment we need to cast the id from
EntityId
toUUID
:I would be willing to submit a PR to fix this issue
The text was updated successfully, but these errors were encountered: