Closed Ketec closed 10 months ago
store
No
withEntities<AssetEntity>({ idKey: 'uuid' }) Results in type error:
withEntities<AssetEntity>({ idKey: 'uuid' })
Argument type {idKey: "uuid"} is not assignable to parameter type {initialValue?: AssetEntity[] | undefined, idKey?: "id" | undefined} | undefined
The type ends up as "id" here: IdKey extends string = "id"
IdKey extends string = "id"
https://stackblitz.com/edit/angular-ivy-ykgajg?file=src%2Fapp%2Ftodos%2Fstate%2Ftodos.repository.ts
No response
"typescript": "4.9.5" tsconfig is in strict mode
Start a new pull request in StackBlitz Codeflow.
Where do you have uuid key in Todo?
See https://ngneat.github.io/elf/docs/features/entities-management/entities/#idkey
Which @ngneat/elf-* package(s) are the source of the bug?
store
Is this a regression?
No
Description
withEntities<AssetEntity>({ idKey: 'uuid' })
Results in type error:Argument type {idKey: "uuid"} is not assignable to parameter type {initialValue?: AssetEntity[] | undefined, idKey?: "id" | undefined} | undefined
The type ends up as "id" here:
IdKey extends string = "id"
Please provide a link to a minimal reproduction of the bug
https://stackblitz.com/edit/angular-ivy-ykgajg?file=src%2Fapp%2Ftodos%2Fstate%2Ftodos.repository.ts
Please provide the exception or error you saw
No response
Please provide the environment you discovered this bug in
No response
Anything else?
"typescript": "4.9.5" tsconfig is in strict mode
Do you want to create a pull request?
No