6 lines
440 B
JavaScript
6 lines
440 B
JavaScript
|
import { wrapMapToPropsConstant, wrapMapToPropsFunc } from './wrapMapToProps';
|
||
|
import { createInvalidArgFactory } from './invalidArgFactory';
|
||
|
export function mapStateToPropsFactory(mapStateToProps) {
|
||
|
return !mapStateToProps ? wrapMapToPropsConstant(() => ({})) : typeof mapStateToProps === 'function' ? // @ts-ignore
|
||
|
wrapMapToPropsFunc(mapStateToProps, 'mapStateToProps') : createInvalidArgFactory(mapStateToProps, 'mapStateToProps');
|
||
|
}
|