wiredprogrammer
wiredprogrammer

Reputation: 555

In ngrx effect the operator after concatLatestFrom marks the action as type never

I'm getting a TypeScript syntax error in the filter operator saying Property "searchCriteria" does not exist on type "never".

I must be failing in my understanding of concatLatestFrom because I can't get this operator to work (compile) in the effect and I can't find any other places where people are having a similar issue.

  loadSearchResults$ = createEffect(() => this.actions$.pipe(
    ofType(searchActions.SearchApi.type),
    concatLatestFrom((action) =>
      this.searchStore.pipe(select(fromSearchSelectors.getSelectedRecordRangeResults))), 
    filter(([action, recordResultList]) => !recordResultList[createRowID(action.searchCriteria.recordRange)]),

Upvotes: 1

Views: 865

Answers (1)

wiredprogrammer
wiredprogrammer

Reputation: 555

Found the problem, ofType(searchActions.SearchApi.type) needed only ofType(searchActions.SearchApi). So I didn't need to give the "type" off the creator class.

Upvotes: 1

Related Questions