Answer the question
In order to leave comments, you need to log in
What expression is typescript expecting?
Guys hello everyone. There is such a code
@Effect({dispatch: false})
authLogout = this.actions$
.ofType(AuthActions.LOGOUT)
.pipe (do(() => {
this.router.navigate(['/']);
}))
Answer the question
In order to leave comments, you need to log in
The effect should return some kind of action in the pipe. To make the transition in the reducer to the next action. https://github.com/ang5-examples/ngrx-store-effect...
And it seems that routing in the effect is not the best place. There, for example, data is being pumped from external sources, such as api, localstorage, etc. And then this data is merged to be passed to the next action.
https://github.com/ngrx/effects/blob/master/docs/i...
Even if it is not planned to proceed to the next action (dispatch: false). You still need to return (in switchMap) something observable or at least null.
www.wisdomofjim.com/blog/how-to-create-an-ngrx-eff...
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question