I am using ngrx/effects.
How can I dispatch an empty action?
This is how I am doing now:
@Effect() foo$ = this.actions$
.ofType(Actions.FOO)
.withLatestFrom(this.store, (action, state) => ({ action, state }))
.map(({ action, state }) => {
if (state.foo.isCool) {
return { type: Actions.BAR };
} else {
return { type: 'NOT_EXIST' };
}
});
Since I have to return an action, I am using return { type: 'NOT_EXIST' };
.
Is there a better way to do this?