UNPKG

@reactory/switch-map

Version:
6 lines (5 loc) 422 B
declare function switchMap<T extends string | number | symbol, U = any>(expression: T, cases: Partial<Record<T, U>> & Partial<Record<'default', U>> & Record<string, U>): U; declare function switchMap<T extends string | number | symbol, U = any, V = any>(expression: T, cases: Partial<Record<T, U>> & Partial<Record<'default', U>> & Record<string, U>, options?: { fallback?: U | V; }): U | V; export default switchMap;