import { ofType } from 'redux-observable';
import { concat, of } from 'rxjs';
import { concatMap } from 'rxjs/operators';

import { updateLiveEventFlowAction, updateLiveStreamAction } from '../slices';

export default (action$) =>
  action$.pipe(
    ofType(updateLiveEventFlowAction.type),
    concatMap(() => concat(of(updateLiveStreamAction()))),
  );
