2

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.

Mister_L
  • 2,469
  • 6
  • 30
  • 64

1 Answers1

0

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)
User
  • 314
  • 2
  • 3
  • 15