angularreduxrxjsngrx-storeangular-redux

NGRX Redux store -- selecting only a slice of the state returns 'undefined' even if intellisense autocompletes and everything in the model matches


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.


Solution

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