In a client project I use NGRX/Store and NGRX/Entity.
While the majority of the store consists of the Entities, I have to store additional values in the state. For business reasons, I need the length of all items at a certain point in time.
export interface State extends EntityState<Item> {
initialItemListSize: number; // this should hold the length of entity-adapters items-list-size at a certain point
}
Anyway, at some point I just want to
this.store.dispactch(saveItemListSizeNow);
call.
Now I'm wondering where I have to implement the logic (get the list length).
At first I thought in the reducer
on(Itemctions.saveItemListSizeNow, (state) => {
const size = ... //<--- no Idea how to get the length here
return { ...state, initialItemListSize: size };
}),
Can someone give me an answer?