react-redux
Version:
Official React bindings for Redux
18 lines (14 loc) • 552 B
text/typescript
import {
MapToProps,
wrapMapToPropsConstant,
wrapMapToPropsFunc,
} from './wrapMapToProps'
export function whenMapStateToPropsIsFunction(mapStateToProps?: MapToProps) {
return typeof mapStateToProps === 'function'
? wrapMapToPropsFunc(mapStateToProps, 'mapStateToProps')
: undefined
}
export function whenMapStateToPropsIsMissing(mapStateToProps?: MapToProps) {
return !mapStateToProps ? wrapMapToPropsConstant(() => ({})) : undefined
}
export default [whenMapStateToPropsIsFunction, whenMapStateToPropsIsMissing]