import mergeWith from 'lodash/mergeWith' ; import isUndefined from 'lodash/isUndefined' ; import { Selectors , SelectorsBase , State } from './Store' ; export function combineSelectors < T extends State , U1 extends SelectorsBase < T > , U2 extends SelectorsBase < T > > ( selectorsObject1 , selectorsObject2 ) ; export function combineSelectors < T extends State , U1 extends SelectorsBase < T > , U2 extends SelectorsBase < T > , U3 extends SelectorsBase < T > > ( selectorsObject1 , selectorsObject2 , selectorsObject3 ) ; export function combineSelectors < T extends State , U1 extends SelectorsBase < T > , U2 extends SelectorsBase < T > , U3 extends SelectorsBase < T > , U4 extends SelectorsBase < T > > ( selectorsObject1 , selectorsObject2 , selectorsObject3 , selectorsObject4 ) ; export function combineSelectors < T extends State , U1 extends SelectorsBase < T > , U2 extends SelectorsBase < T > , U3 extends SelectorsBase < T > , U4 extends SelectorsBase < T > , U5 extends SelectorsBase < T > > ( selectorsObject1 , selectorsObject2 , selectorsObject3 , selectorsObject4 , selectorsObject5 ) ; export function combineSelectors < T extends State , U1 extends SelectorsBase < T > , U2 extends SelectorsBase < T > , U3 extends SelectorsBase < T > , U4 extends SelectorsBase < T > , U5 extends SelectorsBase < T > , U6 extends SelectorsBase < T > > ( selectorsObject1 , selectorsObject2 , selectorsObject3 , selectorsObject4 , selectorsObject5 , selectorsObject6 ) ; export function combineSelectors < T extends State , U1 extends SelectorsBase < T > , U2 extends SelectorsBase < T > , U3 extends SelectorsBase < T > , U4 extends SelectorsBase < T > , U5 extends SelectorsBase < T > , U6 extends SelectorsBase < T > , U7 extends SelectorsBase < T > > ( selectorsObject1 , selectorsObject2 , selectorsObject3 , selectorsObject4 , selectorsObject5 , selectorsObject6 , selectorsObject7 ) ; export function combineSelectors < T extends State , U1 extends SelectorsBase < T > , U2 extends SelectorsBase < T > , U3 extends SelectorsBase < T > , U4 extends SelectorsBase < T > , U5 extends SelectorsBase < T > , U6 extends SelectorsBase < T > , U7 extends SelectorsBase < T > , U8 extends SelectorsBase < T > > ( selectorsObject1 , selectorsObject2 , selectorsObject3 , selectorsObject4 , selectorsObject5 , selectorsObject6 , selectorsObject7 , selectorsObject8 ) ; export function combineSelectors < T extends State , U1 extends SelectorsBase < T > , U2 extends SelectorsBase < T > , U3 extends SelectorsBase < T > , U4 extends SelectorsBase < T > , U5 extends SelectorsBase < T > , U6 extends SelectorsBase < T > , U7 extends SelectorsBase < T > , U8 extends SelectorsBase < T > , U9 extends SelectorsBase < T > > ( selectorsObject1 , selectorsObject2 , selectorsObject3 , selectorsObject4 , selectorsObject5 , selectorsObject6 , selectorsObject7 , selectorsObject8 , selectorsObject9 ) ; export function combineSelectors < T extends State , U1 extends SelectorsBase < T > , U2 extends SelectorsBase < T > , U3 extends SelectorsBase < T > , U4 extends SelectorsBase < T > , U5 extends SelectorsBase < T > , U6 extends SelectorsBase < T > , U7 extends SelectorsBase < T > , U8 extends SelectorsBase < T > , U9 extends SelectorsBase < T > , U10 extends SelectorsBase < T > > ( selectorsObject1 , selectorsObject2 , selectorsObject3 , selectorsObject4 , selectorsObject5 , selectorsObject6 , selectorsObject7 , selectorsObject8 , selectorsObject9 , selectorsObject10 ) ; export function combineSelectors < T extends State , U1 extends SelectorsBase < T > , U2 extends SelectorsBase < T > , U3 extends SelectorsBase < T > , U4 extends SelectorsBase < T > , U5 extends SelectorsBase < T > , U6 extends SelectorsBase < T > , U7 extends SelectorsBase < T > , U8 extends SelectorsBase < T > , U9 extends SelectorsBase < T > , U10 extends SelectorsBase < T > , U11 extends SelectorsBase < T > > ( selectorsObject1 , selectorsObject2 , selectorsObject3 , selectorsObject4 , selectorsObject5 , selectorsObject6 , selectorsObject7 , selectorsObject8 , selectorsObject9 , selectorsObject10 , selectorsObject11 ) ; export function combineSelectors < T extends State , U1 extends SelectorsBase < T > , U2 extends SelectorsBase < T > , U3 extends SelectorsBase < T > , U4 extends SelectorsBase < T > , U5 extends SelectorsBase < T > , U6 extends SelectorsBase < T > , U7 extends SelectorsBase < T > , U8 extends SelectorsBase < T > , U9 extends SelectorsBase < T > , U10 extends SelectorsBase < T > , U11 extends SelectorsBase < T > , U12 extends SelectorsBase < T > > ( selectorsObject1 , selectorsObject2 , selectorsObject3 , selectorsObject4 , selectorsObject5 , selectorsObject6 , selectorsObject7 , selectorsObject8 , selectorsObject9 , selectorsObject10 , selectorsObject11 , selectorsObject12 ) ; export function combineSelectors < T extends State , U extends SelectorsBase < T > > ( ... selectorsObjects ) { return mergeWith ( selectorsObjects [ 0 ] , ... selectorsObjects . slice ( 1 ) , ( objValue , srcValue , key ) => { if ( ! isUndefined ( objValue ) ) throw new Error ( `duplicate selector key: ${ key }` ) ; } ) ; }