(
/*
selectorFactory is a func that is responsible for returning the selector function used to
compute new props from state, props, and dispatch. For example:
export default connectAdvanced((dispatch, options) => (state, props) => ({
thing: state.things[props.thingId],
saveThing: fields => dispatch(actionCreators.saveThing(props.thingId, fields)),
}))(YourComponent)
Access to dispatch is provided to the factory so selectorFactories can bind actionCreators
outside of their selector as an optimization. Options passed to connectAdvanced are passed to
the selectorFactory, along with displayName and WrappedComponent, as the second argument.
Note that selectorFactory is responsible for all caching/memoization of inbound and outbound
props. Do not use connectAdvanced directly without memoizing results between calls to your
selector, otherwise the Connect component will re-render on every state or props change.
*/
selectorFactory)
| 18719 | } |
| 18720 | |
| 18721 | function connectAdvanced( |
| 18722 | /* |
| 18723 | selectorFactory is a func that is responsible for returning the selector function used to |
| 18724 | compute new props from state, props, and dispatch. For example: |
| 18725 | export default connectAdvanced((dispatch, options) => (state, props) => ({ |
| 18726 | thing: state.things[props.thingId], |
| 18727 | saveThing: fields => dispatch(actionCreators.saveThing(props.thingId, fields)), |
| 18728 | }))(YourComponent) |
| 18729 | Access to dispatch is provided to the factory so selectorFactories can bind actionCreators |
| 18730 | outside of their selector as an optimization. Options passed to connectAdvanced are passed to |
| 18731 | the selectorFactory, along with displayName and WrappedComponent, as the second argument. |
| 18732 | Note that selectorFactory is responsible for all caching/memoization of inbound and outbound |
| 18733 | props. Do not use connectAdvanced directly without memoizing results between calls to your |
| 18734 | selector, otherwise the Connect component will re-render on every state or props change. |
| 18735 | */ |
| 18736 | selectorFactory) { |
| 18737 | var _contextTypes, _childContextTypes; |
| 18738 | |
| 18739 | var _ref = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}, |
| 18740 | _ref$getDisplayName = _ref.getDisplayName, |
| 18741 | getDisplayName = _ref$getDisplayName === undefined ? function (name) { |
| 18742 | return 'ConnectAdvanced(' + name + ')'; |
| 18743 | } : _ref$getDisplayName, |
| 18744 | _ref$methodName = _ref.methodName, |
| 18745 | methodName = _ref$methodName === undefined ? 'connectAdvanced' : _ref$methodName, |
| 18746 | _ref$renderCountProp = _ref.renderCountProp, |
| 18747 | renderCountProp = _ref$renderCountProp === undefined ? undefined : _ref$renderCountProp, |
| 18748 | _ref$shouldHandleStat = _ref.shouldHandleStateChanges, |
| 18749 | shouldHandleStateChanges = _ref$shouldHandleStat === undefined ? true : _ref$shouldHandleStat, |
| 18750 | _ref$storeKey = _ref.storeKey, |
| 18751 | storeKey = _ref$storeKey === undefined ? 'store' : _ref$storeKey, |
| 18752 | _ref$withRef = _ref.withRef, |
| 18753 | withRef = _ref$withRef === undefined ? false : _ref$withRef, |
| 18754 | connectOptions = _objectWithoutProperties(_ref, ['getDisplayName', 'methodName', 'renderCountProp', 'shouldHandleStateChanges', 'storeKey', 'withRef']); |
| 18755 | |
| 18756 | var subscriptionKey = storeKey + 'Subscription'; |
| 18757 | var version = hotReloadingVersion++; |
| 18758 | |
| 18759 | var contextTypes = (_contextTypes = {}, _contextTypes[storeKey] = _PropTypes.storeShape, _contextTypes[subscriptionKey] = _PropTypes.subscriptionShape, _contextTypes); |
| 18760 | var childContextTypes = (_childContextTypes = {}, _childContextTypes[subscriptionKey] = _PropTypes.subscriptionShape, _childContextTypes); |
| 18761 | |
| 18762 | return function wrapWithConnect(WrappedComponent) { |
| 18763 | (0, _invariant2.default)(typeof WrappedComponent == 'function', 'You must pass a component to the function returned by ' + (methodName + '. Instead received ' + JSON.stringify(WrappedComponent))); |
| 18764 | |
| 18765 | var wrappedComponentName = WrappedComponent.displayName || WrappedComponent.name || 'Component'; |
| 18766 | |
| 18767 | var displayName = getDisplayName(wrappedComponentName); |
| 18768 | |
| 18769 | var selectorFactoryOptions = _extends({}, connectOptions, { |
| 18770 | getDisplayName: getDisplayName, |
| 18771 | methodName: methodName, |
| 18772 | renderCountProp: renderCountProp, |
| 18773 | shouldHandleStateChanges: shouldHandleStateChanges, |
| 18774 | storeKey: storeKey, |
| 18775 | withRef: withRef, |
| 18776 | displayName: displayName, |
| 18777 | wrappedComponentName: wrappedComponentName, |
| 18778 | WrappedComponent: WrappedComponent |
nothing calls this directly
no test coverage detected