There is a code
@Effect()
myEffect$ = this.actions$.pipe(
ofType(MyActions.doSomething),
tap(() => this.store.dispatch(MyActions.doSomething2())),
switchMap(action => {
that works. I need to inject a filter right before tap. How to do it so that switchMap doesn't lose the action value?
I'm trying to do it like
@Effect()
myEffect$ = this.actions$.pipe(
ofType(MyActions.doSomething),
switchMap(() => this.store.pipe(select(mySelectors.getAmount), take(1))),
filter(amount => amount <= 0),
tap(() => this.store.dispatch(MyActions.doSomething2())),
switchMap(action => {
....
however it says property action.xxxx doesn't exist on type number
which is clear why. How not to lose the action value returned by MyActions.doSomething?