The answer for the navigation scenario is your b answer
@Effect navigateHome$: any = this.updates$
.whenAction(LoginActions.LOGIN_SUCCEEDED)
.do(this.router.navigate('/home'))
.ignoreElements();
Explanation:
You react to the LOGIN_SUCCESS, and because the router doesn’t return a new action, we need to stop the propagation of the stream, which we do by filtering everything.
If you forget to filter, the router returns undefined, which in turn will lead to the reducer to reduce an undefined value, which usually results in a null pointer when it tries to read the type of the action
Another way to solve it is to use https://github.com/ngrx/router-store
Check the documentation on how to add router-store to your app.
The same effect will now look like this.
import { go } from '@ngrx/router-store';
@Effect navigateHome$: any = this.updates$
.whenAction(LoginActions.LOGIN_SUCCEEDED)
.map(() => go(['/home']));
The go action will dispatch a router action that the router reducer will pick up and trigger a route change.