0
votes

I have a lazy loaded store that is returning a specific selectors with the entire application store (ie it is not reduced). The other selectors in this index.ts are reduced correctly. When I try to call this selector from a component:

this.store.select(getBpFailed).subscribe(res => {
    console.log(res);
})

I get a typescript error that says:

error TS2345: Argument of type '(state: State) => boolean' is not assignable to parameter of type ...[entire store model]

Another odd thing is that when I hover over the selector (in this case getBpFailed) the type hinting does not define it as a MemorizedSelector, where other (working) selectors they are defined as a MemorizedSelector.

Thoughts on how to debug? I've been banging my head off the wall for too long on this one.

1

1 Answers

0
votes

I figured it out, I was referencing the reducer getBpFailed method directly in my component, rather then using the selector in the index.ts file. Thus I was getting the entire store because it wasn't reduced yet. Dumb! Hope this helps anyone else that makes the same mistake.