-
-
Notifications
You must be signed in to change notification settings - Fork 2k
Closed
Labels
Description
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 with 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 }));
},
})
);Describe any alternatives/workarounds you're currently using
No response
I would be willing to submit a PR to fix this issue
- Yes
- No