mapStateToProps.js 504 B

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