MCPcopy
hub / github.com/reduxjs/react-redux / mapStateToPropsFactory

Function mapStateToPropsFactory

src/connect/mapStateToProps.ts:5–14  ·  view source on GitHub ↗
(
  mapStateToProps: MapStateToPropsParam<TStateProps, TOwnProps, State>,
)

Source from the content-addressed store, hash-verified

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}

Callers 1

connect.tsxFile · 0.90

Calls 3

wrapMapToPropsConstantFunction · 0.90
wrapMapToPropsFuncFunction · 0.90
createInvalidArgFactoryFunction · 0.90

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…