How do I get my ngrx/store effect to dispatch an empty action? I'm running Angular 6/rxjs 6:
@Effect()
testEffect$ = this.actions$.ofType(FIRST_ACTION).pipe(
map((x) => {
if (x === y) {
return new SECOND_ACTION;
} else {
fire.some.effect;
return EMPTY;
}
})
);
At the moment, I'm getting two errors: Effect "testEffect$" dispatched an invalid action: [object Object]
followed by TypeError: Actions must have a type property
.
I found this answer, but it doesn't seem to work with ng/rxjs 6. So far, I've tried the following (none work):
EMPTY
, Observable.empty()
, Observable.of()
and Observable.of([])
, { type: 'EMPTY_ACTION' }
Any help would be appreciated! I know I can use { dispatch: false }
, but the actual effect has about five outcomes and only one of them doesn't use an action, so I'd rather have that last one return something as well.