I'm playing with redux-observable to trigger two actions. The first action was based on condition when it is true and second action should be trigger using debounce at 500 seconds. Both observables can be run parallely and not dependent on each other.
So far, i came up with the following which is not a working.
export const updateContent = (content$, { getState }) => {
return content$.ofType(actionTypes.REQ_CHANGE_EDIT)
.flatMap(action =>
Observable.forkJoin(
Observable.if(() => isChanged(getState()),
Observable.of(({ type: actionTypes.CHANGE_EDIT, changed: true }))),
Observable.of({ type: actionTypes.CACHE_CONTENT, isCached: false }).debounceTime(500),
));
};