import { EMPTY , merge , Observable } from 'rxjs' ; import { Epic } from '../../core/createApp/createApp.h' ; export function combineEpics < S > ( epics ) ; export function combineEpics < S1 , S2 > ( epics ) ; export function combineEpics < S1 , S2 , S3 > ( epics ) ; export function combineEpics < S1 , S2 , S3 , S4 > ( epics ) ; export function combineEpics < S1 , S2 , S3 , S4 , S5 > ( epics ) ; export function combineEpics ( epics ) { if ( ! epics . length ) { return ( ) => EMPTY ; } if ( epics . length === 1 ) { return epics [ 0 ] ; } return ( event$ , state$ , staticApi ) : Observable < any > => { const streams = epics . map ( ( epic ) => epic ( event$ , state$ , staticApi ) || EMPTY ) ; return merge ( ... streams ) ; } ; }