3

Using @ngrx-redux/store, the latest verson. I can select via string any slice of the state. When I try to access a property, it returns 'undefined' errors.

Syntax:

this.loadedClients = this.store.select(
      state => state.superUser.loadedClients
    );

using

this.loadedClients = this.store.select('superUser')

works, but using the async pipe to get loadedClients property causes messy markup.

I can't find examples on Google or in the documentation.

Community
  • 1
  • 1
SebastianG
  • 8,563
  • 8
  • 47
  • 111
  • presented string selector doesn't pick the `loadedClients` subproperty. Have you tried `select('superUser', 'loadedClients')` ? – kos Mar 21 '19 at 16:28
  • @Kos surprising enough, the presented selector does get that subproperty with that syntax. I traced back the steps through the functions and turns out I forgot to return the state in one of the reducers which always ran onInit in that specific component... – SebastianG Mar 21 '19 at 21:02

1 Answers1

0

Was an issue inside my reducer messing up with that property -- it shouldn't have worked at all.

SebastianG
  • 8,563
  • 8
  • 47
  • 111