import { Stream , combineArray , just , map , switchLatest } from 'most' ; export function switchCombine < A > ( streams$ ) ; export function switchCombine < A > ( streams$ ) ; export function switchCombine < A > ( streams$ ) { return switchLatest ( map ( ( streams ) => streams . length === 0 ? just ( [ ] ) : combineArray ( Array , streams as Array < Stream < A > > ) , streams$ ) ) ; }