I have an Observable that I want to continue executing until:
1) the uploadActions.MARK_UPLOAD_AS_COMPLETE
action is called with a certain payload
OR
2) the uploadActions.UPLOAD_FAILURE
action is called with any payload
This is as far as I could get (and doesn't work):
return Observable.interval(5000)
.takeUntil(
action$
.ofType(
uploadActions.UPLOAD_FAILURE,
uploadActions.MARK_UPLOAD_AS_COMPLETE
)
.filter(a => { // <---- this filter only applies to uploadActions.MARK_UPLOAD_AS_COMPLETE
const completedFileHandle = a.payload;
return handle === completedFileHandle;
})
)
.mergeMap(action =>
...
);
Is there a clean way I could achieve this?