-
Notifications
You must be signed in to change notification settings - Fork 44
Open
Description
We can use selectId: (x => x.name) in setAllEntities
But not in withEntityResources ?
Or at least its not documented in https://ngrx-toolkit.angulararchitects.io/docs/with-entity-resources
withEntityResources((_store, svc = inject(VenueService)) => ({
todos: resource({ loader: () => firstValueFrom(svc.loadVenues()), defaultValue: [], params: () => { /*???*/ } }),
})), withMutations((store, svc = inject(VenueService)) => ({
loadVenues: rxMutation({
operation: (s: number) => {
return svc.loadVenues().pipe(tap(x => {
// debugger
}));
},
operator: concatOp,
onSuccess: (result) => {
patchState(store, setAllEntities(result, {
collection: 'todos',
selectId: (x => x.name)
}));
},
onError: (error) => {
console.error('Error occurred:', error);
},
}),Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels