source: node_modules/react-redux/src/connect/mapStateToProps.ts@ a762898

Last change on this file since a762898 was a762898, checked in by istevanoska <ilinastevanoska@…>, 5 months ago

Added visualizations

  • Property mode set to 100644
File size: 616 bytes
Line 
1import { wrapMapToPropsConstant, wrapMapToPropsFunc } from './wrapMapToProps'
2import { createInvalidArgFactory } from './invalidArgFactory'
3import type { MapStateToPropsParam } from './selectorFactory'
4
5export function mapStateToPropsFactory<TStateProps, TOwnProps, State>(
6 mapStateToProps: MapStateToPropsParam<TStateProps, TOwnProps, State>,
7) {
8 return !mapStateToProps
9 ? wrapMapToPropsConstant(() => ({}))
10 : typeof mapStateToProps === 'function'
11 ? // @ts-ignore
12 wrapMapToPropsFunc(mapStateToProps, 'mapStateToProps')
13 : createInvalidArgFactory(mapStateToProps, 'mapStateToProps')
14}
Note: See TracBrowser for help on using the repository browser.