Reputation: 16383
I have the following action:
export const searchTM = createAction(
IocActionTypes.SearchTM,
props<{tm: string}>()
);
I have the following code in one of my components:
this.store.dispatch(searchTM(value));
where value
is the string 03F
In my ngrx Effects file I have the following:
searchTM$ = createEffect(() => this.actions$.pipe(
ofType(iocActions.searchTM),
mergeMap(val => this.iocService.getGridRowByTM(val.tm)
.pipe(
map(rowdataraw => iocActions.searchTMFound({rowdataraw})),
catchError(() => {
return EMPTY;
})
)
)
)
);
but when I set a debug point on the mergeMap val
variable, I see it come up like this:
Upvotes: 1
Views: 653
Reputation: 16383
The problem was that I was passing the parameter in the wrong format.
I was using:
this.store.dispatch(searchTM(value));
where I should have been using:
this.store.dispatch(searchTM({tm: value}));
Upvotes: 4