Closed markostanimirovic closed 3 months ago
signals
To allow defining entity identifier from multiple properties, but also for consistency with @ngrx/entity, idKey will be replaced with selectId.
@ngrx/entity
idKey
selectId
Before:
const TodosStore = signalStore( withEntities<Todo>(), withMethods((store) => ({ addTodo(todo: Todo): void { patchState(store, addEntity(todo, { idKey: '_id' })); }, }) );
After:
const selectId = (todo: Todo) => todo._id; const TodosStore = signalStore( withEntities<Todo>(), withMethods((store) => ({ addTodo(todo: Todo): void { patchState(store, addEntity(todo, { selectId })); }, }) );
No response
Which @ngrx/* package(s) are relevant/related to the feature request?
signals
Information
To allow defining entity identifier from multiple properties, but also for consistency with
@ngrx/entity
,idKey
will be replaced withselectId
.Before:
After:
Describe any alternatives/workarounds you're currently using
No response
I would be willing to submit a PR to fix this issue