amis-rpc-design/node_modules/react-redux/es/connect/mapStateToProps.js

6 lines
440 B
JavaScript
Raw Normal View History

2023-10-07 19:42:30 +08:00
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');
}