|
Last change
on this file since ba17441 was a762898, checked in by istevanoska <ilinastevanoska@…>, 5 months ago |
|
Added visualizations
|
-
Property mode
set to
100644
|
|
File size:
616 bytes
|
| Line | |
|---|
| 1 | import { wrapMapToPropsConstant, wrapMapToPropsFunc } from './wrapMapToProps'
|
|---|
| 2 | import { createInvalidArgFactory } from './invalidArgFactory'
|
|---|
| 3 | import type { MapStateToPropsParam } from './selectorFactory'
|
|---|
| 4 |
|
|---|
| 5 | export 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.