You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

mapStateToProps.js 504 B

пре 3 година
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];