1
votes

I have the following store structure for users:

 usersState = {
    isLoading: boolean;
    items: {
       entities: {},
       ids: []
    }
 }

adapter.getSelectors() only works for the top level keys, whereas I want to apply it inside the items key. How can that be done?

Thanks.

1

1 Answers

0
votes

From @ngrx/entity - models.d.ts:

getSelectors<V>(selectState: (state: V) => EntityState<T>): EntitySelectors<T, V>;

You can simply provide a projector to adapter.getSelectors() like this:

adapter.getSelectors((state: YourStateType) => state.items)