25개 이상의 토픽을 선택하실 수 없습니다. Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

mapStateToProps.js 503 B

3 년 전
12345678910111213
  1. import { wrapMapToPropsConstant, wrapMapToPropsFunc } from './wrapMapToProps'
  2. export function whenMapStateToPropsIsFunction(mapStateToProps) {
  3. return typeof mapStateToProps === 'function'
  4. ? wrapMapToPropsFunc(mapStateToProps, 'mapStateToProps')
  5. : undefined
  6. }
  7. export function whenMapStateToPropsIsMissing(mapStateToProps) {
  8. return !mapStateToProps ? wrapMapToPropsConstant(() => ({})) : undefined
  9. }
  10. export default [whenMapStateToPropsIsFunction, whenMapStateToPropsIsMissing]