react-redux
Advanced tools
Comparing version 5.0.0-beta.3 to 5.0.0-rc.1
@@ -10,3 +10,3 @@ (function webpackUniversalModuleDefinition(root, factory) { | ||
root["ReactRedux"] = factory(root["React"], root["Redux"]); | ||
})(this, function(__WEBPACK_EXTERNAL_MODULE_2__, __WEBPACK_EXTERNAL_MODULE_22__) { | ||
})(this, function(__WEBPACK_EXTERNAL_MODULE_2__, __WEBPACK_EXTERNAL_MODULE_28__) { | ||
return /******/ (function(modules) { // webpackBootstrap | ||
@@ -63,3 +63,3 @@ /******/ // The module cache | ||
var _Provider = __webpack_require__(7); | ||
var _Provider = __webpack_require__(8); | ||
@@ -72,3 +72,3 @@ var _Provider2 = _interopRequireDefault(_Provider); | ||
var _connect = __webpack_require__(8); | ||
var _connect = __webpack_require__(9); | ||
@@ -131,7 +131,7 @@ var _connect2 = _interopRequireDefault(_connect); | ||
var _hoistNonReactStatics = __webpack_require__(16); | ||
var _hoistNonReactStatics = __webpack_require__(17); | ||
var _hoistNonReactStatics2 = _interopRequireDefault(_hoistNonReactStatics); | ||
var _invariant = __webpack_require__(17); | ||
var _invariant = __webpack_require__(18); | ||
@@ -142,3 +142,3 @@ var _invariant2 = _interopRequireDefault(_invariant); | ||
var _Subscription = __webpack_require__(14); | ||
var _Subscription = __webpack_require__(15); | ||
@@ -161,2 +161,3 @@ var _Subscription2 = _interopRequireDefault(_Subscription); | ||
var defaultReact15CompatibilityMode = true; | ||
var hotReloadingVersion = 0; | ||
@@ -173,3 +174,3 @@ function connectAdvanced( | ||
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. | ||
the selectorFactory, along with displayName and WrappedComponent, as the second argument. | ||
Note that selectorFactory is responsible for all caching/memoization of inbound and outbound | ||
@@ -182,25 +183,25 @@ props. Do not use connectAdvanced directly without memoizing results between calls to your | ||
var _ref = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; | ||
var _ref$getDisplayName = _ref.getDisplayName; | ||
var getDisplayName = _ref$getDisplayName === undefined ? function (name) { | ||
var _ref = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}, | ||
_ref$getDisplayName = _ref.getDisplayName, | ||
getDisplayName = _ref$getDisplayName === undefined ? function (name) { | ||
return 'ConnectAdvanced(' + name + ')'; | ||
} : _ref$getDisplayName; | ||
var _ref$methodName = _ref.methodName; | ||
var methodName = _ref$methodName === undefined ? 'connectAdvanced' : _ref$methodName; | ||
var _ref$renderCountProp = _ref.renderCountProp; | ||
var renderCountProp = _ref$renderCountProp === undefined ? undefined : _ref$renderCountProp; | ||
var _ref$shouldHandleStat = _ref.shouldHandleStateChanges; | ||
var shouldHandleStateChanges = _ref$shouldHandleStat === undefined ? true : _ref$shouldHandleStat; | ||
var _ref$storeKey = _ref.storeKey; | ||
var storeKey = _ref$storeKey === undefined ? 'store' : _ref$storeKey; | ||
var _ref$withRef = _ref.withRef; | ||
var withRef = _ref$withRef === undefined ? false : _ref$withRef; | ||
} : _ref$getDisplayName, | ||
_ref$methodName = _ref.methodName, | ||
methodName = _ref$methodName === undefined ? 'connectAdvanced' : _ref$methodName, | ||
_ref$react15Compatibi = _ref.react15CompatibilityMode, | ||
react15CompatibilityMode = _ref$react15Compatibi === undefined ? undefined : _ref$react15Compatibi, | ||
_ref$renderCountProp = _ref.renderCountProp, | ||
renderCountProp = _ref$renderCountProp === undefined ? undefined : _ref$renderCountProp, | ||
_ref$shouldHandleStat = _ref.shouldHandleStateChanges, | ||
shouldHandleStateChanges = _ref$shouldHandleStat === undefined ? true : _ref$shouldHandleStat, | ||
_ref$storeKey = _ref.storeKey, | ||
storeKey = _ref$storeKey === undefined ? 'store' : _ref$storeKey, | ||
_ref$withRef = _ref.withRef, | ||
withRef = _ref$withRef === undefined ? false : _ref$withRef, | ||
connectOptions = _objectWithoutProperties(_ref, ['getDisplayName', 'methodName', 'react15CompatibilityMode', 'renderCountProp', 'shouldHandleStateChanges', 'storeKey', 'withRef']); | ||
var connectOptions = _objectWithoutProperties(_ref, ['getDisplayName', 'methodName', 'renderCountProp', 'shouldHandleStateChanges', 'storeKey', 'withRef']); | ||
var subscriptionKey = storeKey + 'Subscription'; | ||
var version = hotReloadingVersion++; | ||
var contextTypes = (_contextTypes = {}, _contextTypes[storeKey] = _storeShape2.default, _contextTypes[subscriptionKey] = _react.PropTypes.instanceOf(_Subscription2.default), _contextTypes); | ||
var contextTypes = (_contextTypes = {}, _contextTypes[storeKey] = _storeShape2.default, _contextTypes[subscriptionKey] = _react.PropTypes.instanceOf(_Subscription2.default), _contextTypes.react15CompatibilityMode = _react.PropTypes.bool, _contextTypes); | ||
var childContextTypes = (_childContextTypes = {}, _childContextTypes[subscriptionKey] = _react.PropTypes.instanceOf(_Subscription2.default), _childContextTypes); | ||
@@ -223,2 +224,3 @@ | ||
displayName: displayName, | ||
wrappedComponentName: wrappedComponentName, | ||
WrappedComponent: WrappedComponent | ||
@@ -239,3 +241,12 @@ }); | ||
_this.store = _this.props[storeKey] || _this.context[storeKey]; | ||
_this.parentSub = _this.props[subscriptionKey] || _this.context[subscriptionKey]; | ||
// react15CompatibilityMode controls whether the subscription system is used. This is for | ||
// https://github.com/reactjs/react-redux/issues/525 and should be removed completely when | ||
// react-redux's dependency on react is bumped to mimimum v16, which is expected to include | ||
// PR https://github.com/facebook/react/pull/8204 which fixes the issue. | ||
var compatMode = [react15CompatibilityMode, props.react15CompatibilityMode, context.react15CompatibilityMode, defaultReact15CompatibilityMode].find(function (cm) { | ||
return cm !== undefined && cm !== null; | ||
}); | ||
_this.parentSub = compatMode ? null : props[subscriptionKey] || context[subscriptionKey]; | ||
_this.setWrappedInstance = _this.setWrappedInstance.bind(_this); | ||
@@ -403,2 +414,6 @@ | ||
connectAdvanced.setDefaultReact15CompatibilityMode = function setDefaultReact15CompatibilityMode(compat) { | ||
defaultReact15CompatibilityMode = compat; | ||
}; | ||
/***/ }, | ||
@@ -510,3 +525,3 @@ /* 4 */ | ||
var _isPlainObject = __webpack_require__(21); | ||
var _isPlainObject = __webpack_require__(27); | ||
@@ -531,2 +546,14 @@ var _isPlainObject2 = _interopRequireDefault(_isPlainObject); | ||
var root = __webpack_require__(25); | ||
/** Built-in value references. */ | ||
var Symbol = root.Symbol; | ||
module.exports = Symbol; | ||
/***/ }, | ||
/* 8 */ | ||
/***/ function(module, exports, __webpack_require__) { | ||
'use strict'; | ||
@@ -613,3 +640,3 @@ | ||
/***/ }, | ||
/* 8 */ | ||
/* 9 */ | ||
/***/ function(module, exports, __webpack_require__) { | ||
@@ -629,19 +656,19 @@ | ||
var _shallowEqual = __webpack_require__(15); | ||
var _shallowEqual = __webpack_require__(16); | ||
var _shallowEqual2 = _interopRequireDefault(_shallowEqual); | ||
var _mapDispatchToProps = __webpack_require__(9); | ||
var _mapDispatchToProps = __webpack_require__(10); | ||
var _mapDispatchToProps2 = _interopRequireDefault(_mapDispatchToProps); | ||
var _mapStateToProps = __webpack_require__(10); | ||
var _mapStateToProps = __webpack_require__(11); | ||
var _mapStateToProps2 = _interopRequireDefault(_mapStateToProps); | ||
var _mergeProps = __webpack_require__(11); | ||
var _mergeProps = __webpack_require__(12); | ||
var _mergeProps2 = _interopRequireDefault(_mergeProps); | ||
var _selectorFactory = __webpack_require__(12); | ||
var _selectorFactory = __webpack_require__(13); | ||
@@ -671,3 +698,3 @@ var _selectorFactory2 = _interopRequireDefault(_selectorFactory); | ||
function match(arg, factories) { | ||
function match(arg, factories, name) { | ||
for (var i = factories.length - 1; i >= 0; i--) { | ||
@@ -677,3 +704,6 @@ var result = factories[i](arg); | ||
} | ||
return undefined; | ||
return function (dispatch, options) { | ||
throw new Error('Invalid value of type ' + typeof arg + ' for ' + name + ' argument when connecting component ' + options.wrappedComponentName + '.'); | ||
}; | ||
} | ||
@@ -688,35 +718,32 @@ | ||
function createConnect() { | ||
var _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; | ||
var _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}, | ||
_ref$connectHOC = _ref.connectHOC, | ||
connectHOC = _ref$connectHOC === undefined ? _connectAdvanced2.default : _ref$connectHOC, | ||
_ref$mapStateToPropsF = _ref.mapStateToPropsFactories, | ||
mapStateToPropsFactories = _ref$mapStateToPropsF === undefined ? _mapStateToProps2.default : _ref$mapStateToPropsF, | ||
_ref$mapDispatchToPro = _ref.mapDispatchToPropsFactories, | ||
mapDispatchToPropsFactories = _ref$mapDispatchToPro === undefined ? _mapDispatchToProps2.default : _ref$mapDispatchToPro, | ||
_ref$mergePropsFactor = _ref.mergePropsFactories, | ||
mergePropsFactories = _ref$mergePropsFactor === undefined ? _mergeProps2.default : _ref$mergePropsFactor, | ||
_ref$selectorFactory = _ref.selectorFactory, | ||
selectorFactory = _ref$selectorFactory === undefined ? _selectorFactory2.default : _ref$selectorFactory; | ||
var _ref$connectHOC = _ref.connectHOC; | ||
var connectHOC = _ref$connectHOC === undefined ? _connectAdvanced2.default : _ref$connectHOC; | ||
var _ref$mapStateToPropsF = _ref.mapStateToPropsFactories; | ||
var mapStateToPropsFactories = _ref$mapStateToPropsF === undefined ? _mapStateToProps2.default : _ref$mapStateToPropsF; | ||
var _ref$mapDispatchToPro = _ref.mapDispatchToPropsFactories; | ||
var mapDispatchToPropsFactories = _ref$mapDispatchToPro === undefined ? _mapDispatchToProps2.default : _ref$mapDispatchToPro; | ||
var _ref$mergePropsFactor = _ref.mergePropsFactories; | ||
var mergePropsFactories = _ref$mergePropsFactor === undefined ? _mergeProps2.default : _ref$mergePropsFactor; | ||
var _ref$selectorFactory = _ref.selectorFactory; | ||
var selectorFactory = _ref$selectorFactory === undefined ? _selectorFactory2.default : _ref$selectorFactory; | ||
return function connect(mapStateToProps, mapDispatchToProps, mergeProps) { | ||
var _ref2 = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {}; | ||
var _ref2 = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {}, | ||
_ref2$pure = _ref2.pure, | ||
pure = _ref2$pure === undefined ? true : _ref2$pure, | ||
_ref2$areStatesEqual = _ref2.areStatesEqual, | ||
areStatesEqual = _ref2$areStatesEqual === undefined ? strictEqual : _ref2$areStatesEqual, | ||
_ref2$areOwnPropsEqua = _ref2.areOwnPropsEqual, | ||
areOwnPropsEqual = _ref2$areOwnPropsEqua === undefined ? _shallowEqual2.default : _ref2$areOwnPropsEqua, | ||
_ref2$areStatePropsEq = _ref2.areStatePropsEqual, | ||
areStatePropsEqual = _ref2$areStatePropsEq === undefined ? _shallowEqual2.default : _ref2$areStatePropsEq, | ||
_ref2$areMergedPropsE = _ref2.areMergedPropsEqual, | ||
areMergedPropsEqual = _ref2$areMergedPropsE === undefined ? _shallowEqual2.default : _ref2$areMergedPropsE, | ||
extraOptions = _objectWithoutProperties(_ref2, ['pure', 'areStatesEqual', 'areOwnPropsEqual', 'areStatePropsEqual', 'areMergedPropsEqual']); | ||
var _ref2$pure = _ref2.pure; | ||
var pure = _ref2$pure === undefined ? true : _ref2$pure; | ||
var _ref2$areStatesEqual = _ref2.areStatesEqual; | ||
var areStatesEqual = _ref2$areStatesEqual === undefined ? strictEqual : _ref2$areStatesEqual; | ||
var _ref2$areOwnPropsEqua = _ref2.areOwnPropsEqual; | ||
var areOwnPropsEqual = _ref2$areOwnPropsEqua === undefined ? _shallowEqual2.default : _ref2$areOwnPropsEqua; | ||
var _ref2$areStatePropsEq = _ref2.areStatePropsEqual; | ||
var areStatePropsEqual = _ref2$areStatePropsEq === undefined ? _shallowEqual2.default : _ref2$areStatePropsEq; | ||
var _ref2$areMergedPropsE = _ref2.areMergedPropsEqual; | ||
var areMergedPropsEqual = _ref2$areMergedPropsE === undefined ? _shallowEqual2.default : _ref2$areMergedPropsE; | ||
var initMapStateToProps = match(mapStateToProps, mapStateToPropsFactories, 'mapStateToProps'); | ||
var initMapDispatchToProps = match(mapDispatchToProps, mapDispatchToPropsFactories, 'mapDispatchToProps'); | ||
var initMergeProps = match(mergeProps, mergePropsFactories, 'mergeProps'); | ||
var extraOptions = _objectWithoutProperties(_ref2, ['pure', 'areStatesEqual', 'areOwnPropsEqual', 'areStatePropsEqual', 'areMergedPropsEqual']); | ||
var initMapStateToProps = match(mapStateToProps, mapStateToPropsFactories); | ||
var initMapDispatchToProps = match(mapDispatchToProps, mapDispatchToPropsFactories); | ||
var initMergeProps = match(mergeProps, mergePropsFactories); | ||
return connectHOC(selectorFactory, _extends({ | ||
@@ -748,6 +775,8 @@ // used in error messages | ||
exports.default = createConnect(); | ||
var connect = createConnect(); | ||
connect.setDefaultReact15CompatibilityMode = _connectAdvanced2.default.setDefaultReact15CompatibilityMode; | ||
exports.default = connect; | ||
/***/ }, | ||
/* 9 */ | ||
/* 10 */ | ||
/***/ function(module, exports, __webpack_require__) { | ||
@@ -762,3 +791,3 @@ | ||
var _redux = __webpack_require__(22); | ||
var _redux = __webpack_require__(28); | ||
@@ -786,3 +815,3 @@ var _wrapMapToProps = __webpack_require__(4); | ||
/***/ }, | ||
/* 10 */ | ||
/* 11 */ | ||
/***/ function(module, exports, __webpack_require__) { | ||
@@ -811,3 +840,3 @@ | ||
/***/ }, | ||
/* 11 */ | ||
/* 12 */ | ||
/***/ function(module, exports, __webpack_require__) { | ||
@@ -838,5 +867,5 @@ | ||
return function initMergePropsProxy(dispatch, _ref) { | ||
var displayName = _ref.displayName; | ||
var pure = _ref.pure; | ||
var areMergedPropsEqual = _ref.areMergedPropsEqual; | ||
var displayName = _ref.displayName, | ||
pure = _ref.pure, | ||
areMergedPropsEqual = _ref.areMergedPropsEqual; | ||
@@ -876,3 +905,3 @@ var hasRunOnce = false; | ||
/***/ }, | ||
/* 12 */ | ||
/* 13 */ | ||
/***/ function(module, exports, __webpack_require__) { | ||
@@ -887,3 +916,3 @@ | ||
var _verifySubselectors = __webpack_require__(13); | ||
var _verifySubselectors = __webpack_require__(14); | ||
@@ -903,5 +932,5 @@ var _verifySubselectors2 = _interopRequireDefault(_verifySubselectors); | ||
function pureFinalPropsSelectorFactory(mapStateToProps, mapDispatchToProps, mergeProps, dispatch, _ref) { | ||
var areStatesEqual = _ref.areStatesEqual; | ||
var areOwnPropsEqual = _ref.areOwnPropsEqual; | ||
var areStatePropsEqual = _ref.areStatePropsEqual; | ||
var areStatesEqual = _ref.areStatesEqual, | ||
areOwnPropsEqual = _ref.areOwnPropsEqual, | ||
areStatePropsEqual = _ref.areStatePropsEqual; | ||
@@ -978,8 +1007,7 @@ var hasRunAtLeastOnce = false; | ||
function finalPropsSelectorFactory(dispatch, _ref2) { | ||
var initMapStateToProps = _ref2.initMapStateToProps; | ||
var initMapDispatchToProps = _ref2.initMapDispatchToProps; | ||
var initMergeProps = _ref2.initMergeProps; | ||
var initMapStateToProps = _ref2.initMapStateToProps, | ||
initMapDispatchToProps = _ref2.initMapDispatchToProps, | ||
initMergeProps = _ref2.initMergeProps, | ||
options = _objectWithoutProperties(_ref2, ['initMapStateToProps', 'initMapDispatchToProps', 'initMergeProps']); | ||
var options = _objectWithoutProperties(_ref2, ['initMapStateToProps', 'initMapDispatchToProps', 'initMergeProps']); | ||
var mapStateToProps = initMapStateToProps(dispatch, options); | ||
@@ -999,3 +1027,3 @@ var mapDispatchToProps = initMapDispatchToProps(dispatch, options); | ||
/***/ }, | ||
/* 13 */ | ||
/* 14 */ | ||
/***/ function(module, exports, __webpack_require__) { | ||
@@ -1031,3 +1059,3 @@ | ||
/***/ }, | ||
/* 14 */ | ||
/* 15 */ | ||
/***/ function(module, exports) { | ||
@@ -1059,5 +1087,5 @@ | ||
notify: function notify() { | ||
current = next; | ||
for (var i = 0; i < current.length; i++) { | ||
current[i](); | ||
var listeners = current = next; | ||
for (var i = 0; i < listeners.length; i++) { | ||
listeners[i](); | ||
} | ||
@@ -1128,3 +1156,3 @@ }, | ||
/***/ }, | ||
/* 15 */ | ||
/* 16 */ | ||
/***/ function(module, exports) { | ||
@@ -1157,3 +1185,3 @@ | ||
/***/ }, | ||
/* 16 */ | ||
/* 17 */ | ||
/***/ function(module, exports) { | ||
@@ -1214,3 +1242,3 @@ | ||
/***/ }, | ||
/* 17 */ | ||
/* 18 */ | ||
/***/ function(module, exports, __webpack_require__) { | ||
@@ -1272,8 +1300,54 @@ | ||
/***/ }, | ||
/* 18 */ | ||
/* 19 */ | ||
/***/ function(module, exports, __webpack_require__) { | ||
var overArg = __webpack_require__(19); | ||
var Symbol = __webpack_require__(7), | ||
getRawTag = __webpack_require__(22), | ||
objectToString = __webpack_require__(23); | ||
/** `Object#toString` result references. */ | ||
var nullTag = '[object Null]', | ||
undefinedTag = '[object Undefined]'; | ||
/** Built-in value references. */ | ||
var symToStringTag = Symbol ? Symbol.toStringTag : undefined; | ||
/** | ||
* The base implementation of `getTag` without fallbacks for buggy environments. | ||
* | ||
* @private | ||
* @param {*} value The value to query. | ||
* @returns {string} Returns the `toStringTag`. | ||
*/ | ||
function baseGetTag(value) { | ||
if (value == null) { | ||
return value === undefined ? undefinedTag : nullTag; | ||
} | ||
value = Object(value); | ||
return (symToStringTag && symToStringTag in value) | ||
? getRawTag(value) | ||
: objectToString(value); | ||
} | ||
module.exports = baseGetTag; | ||
/***/ }, | ||
/* 20 */ | ||
/***/ function(module, exports) { | ||
/* WEBPACK VAR INJECTION */(function(global) {/** Detect free variable `global` from Node.js. */ | ||
var freeGlobal = typeof global == 'object' && global && global.Object === Object && global; | ||
module.exports = freeGlobal; | ||
/* WEBPACK VAR INJECTION */}.call(exports, (function() { return this; }()) || Function('return this')())) | ||
/***/ }, | ||
/* 21 */ | ||
/***/ function(module, exports, __webpack_require__) { | ||
var overArg = __webpack_require__(24); | ||
/** Built-in value references. */ | ||
var getPrototype = overArg(Object.getPrototypeOf, Object); | ||
@@ -1285,6 +1359,86 @@ | ||
/***/ }, | ||
/* 19 */ | ||
/* 22 */ | ||
/***/ function(module, exports, __webpack_require__) { | ||
var Symbol = __webpack_require__(7); | ||
/** Used for built-in method references. */ | ||
var objectProto = Object.prototype; | ||
/** Used to check objects for own properties. */ | ||
var hasOwnProperty = objectProto.hasOwnProperty; | ||
/** | ||
* Used to resolve the | ||
* [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring) | ||
* of values. | ||
*/ | ||
var nativeObjectToString = objectProto.toString; | ||
/** Built-in value references. */ | ||
var symToStringTag = Symbol ? Symbol.toStringTag : undefined; | ||
/** | ||
* A specialized version of `baseGetTag` which ignores `Symbol.toStringTag` values. | ||
* | ||
* @private | ||
* @param {*} value The value to query. | ||
* @returns {string} Returns the raw `toStringTag`. | ||
*/ | ||
function getRawTag(value) { | ||
var isOwn = hasOwnProperty.call(value, symToStringTag), | ||
tag = value[symToStringTag]; | ||
try { | ||
value[symToStringTag] = undefined; | ||
var unmasked = true; | ||
} catch (e) {} | ||
var result = nativeObjectToString.call(value); | ||
if (unmasked) { | ||
if (isOwn) { | ||
value[symToStringTag] = tag; | ||
} else { | ||
delete value[symToStringTag]; | ||
} | ||
} | ||
return result; | ||
} | ||
module.exports = getRawTag; | ||
/***/ }, | ||
/* 23 */ | ||
/***/ function(module, exports) { | ||
/** Used for built-in method references. */ | ||
var objectProto = Object.prototype; | ||
/** | ||
* Used to resolve the | ||
* [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring) | ||
* of values. | ||
*/ | ||
var nativeObjectToString = objectProto.toString; | ||
/** | ||
* Converts `value` to a string using `Object.prototype.toString`. | ||
* | ||
* @private | ||
* @param {*} value The value to convert. | ||
* @returns {string} Returns the converted string. | ||
*/ | ||
function objectToString(value) { | ||
return nativeObjectToString.call(value); | ||
} | ||
module.exports = objectToString; | ||
/***/ }, | ||
/* 24 */ | ||
/***/ function(module, exports) { | ||
/** | ||
* Creates a unary function that invokes `func` with its argument transformed. | ||
@@ -1307,3 +1461,18 @@ * | ||
/***/ }, | ||
/* 20 */ | ||
/* 25 */ | ||
/***/ function(module, exports, __webpack_require__) { | ||
var freeGlobal = __webpack_require__(20); | ||
/** Detect free variable `self`. */ | ||
var freeSelf = typeof self == 'object' && self && self.Object === Object && self; | ||
/** Used as a reference to the global object. */ | ||
var root = freeGlobal || freeSelf || Function('return this')(); | ||
module.exports = root; | ||
/***/ }, | ||
/* 26 */ | ||
/***/ function(module, exports) { | ||
@@ -1343,7 +1512,8 @@ | ||
/***/ }, | ||
/* 21 */ | ||
/* 27 */ | ||
/***/ function(module, exports, __webpack_require__) { | ||
var getPrototype = __webpack_require__(18), | ||
isObjectLike = __webpack_require__(20); | ||
var baseGetTag = __webpack_require__(19), | ||
getPrototype = __webpack_require__(21), | ||
isObjectLike = __webpack_require__(26); | ||
@@ -1367,9 +1537,2 @@ /** `Object#toString` result references. */ | ||
/** | ||
* Used to resolve the | ||
* [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring) | ||
* of values. | ||
*/ | ||
var objectToString = objectProto.toString; | ||
/** | ||
* Checks if `value` is a plain object, that is, an object created by the | ||
@@ -1403,3 +1566,3 @@ * `Object` constructor or one with a `[[Prototype]]` of `null`. | ||
function isPlainObject(value) { | ||
if (!isObjectLike(value) || objectToString.call(value) != objectTag) { | ||
if (!isObjectLike(value) || baseGetTag(value) != objectTag) { | ||
return false; | ||
@@ -1412,4 +1575,4 @@ } | ||
var Ctor = hasOwnProperty.call(proto, 'constructor') && proto.constructor; | ||
return (typeof Ctor == 'function' && | ||
Ctor instanceof Ctor && funcToString.call(Ctor) == objectCtorString); | ||
return typeof Ctor == 'function' && Ctor instanceof Ctor && | ||
funcToString.call(Ctor) == objectCtorString; | ||
} | ||
@@ -1421,6 +1584,6 @@ | ||
/***/ }, | ||
/* 22 */ | ||
/* 28 */ | ||
/***/ function(module, exports) { | ||
module.exports = __WEBPACK_EXTERNAL_MODULE_22__; | ||
module.exports = __WEBPACK_EXTERNAL_MODULE_28__; | ||
@@ -1427,0 +1590,0 @@ /***/ } |
@@ -1,1 +0,1 @@ | ||
!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e(require("react"),require("redux")):"function"==typeof define&&define.amd?define(["react","redux"],e):"object"==typeof exports?exports.ReactRedux=e(require("react"),require("redux")):t.ReactRedux=e(t.React,t.Redux)}(this,function(t,e){return function(t){function e(r){if(n[r])return n[r].exports;var o=n[r]={exports:{},id:r,loaded:!1};return t[r].call(o.exports,o,o.exports,e),o.loaded=!0,o.exports}var n={};return e.m=t,e.c=n,e.p="",e(0)}([function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{"default":t}}e.__esModule=!0,e.connect=e.connectAdvanced=e.Provider=void 0;var o=n(7),i=r(o),s=n(3),u=r(s),a=n(8),p=r(a);e.Provider=i.default,e.connectAdvanced=u.default,e.connect=p.default},function(t,e){"use strict";function n(t){"undefined"!=typeof console&&"function"==typeof console.error&&console.error(t);try{throw Error(t)}catch(e){}}e.__esModule=!0,e.default=n},function(e,n){e.exports=t},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{"default":t}}function o(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function i(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function s(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}function u(t,e){var n={};for(var r in t)e.indexOf(r)<0&&Object.prototype.hasOwnProperty.call(t,r)&&(n[r]=t[r]);return n}function a(t){var e,n,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},a=r.getDisplayName,c=void 0===a?function(t){return"ConnectAdvanced("+t+")"}:a,d=r.methodName,y=void 0===d?"connectAdvanced":d,b=r.renderCountProp,m=void 0===b?void 0:b,w=r.shouldHandleStateChanges,g=void 0===w||w,M=r.storeKey,_=void 0===M?"store":M,S=r.withRef,T=void 0!==S&&S,x=u(r,["getDisplayName","methodName","renderCountProp","shouldHandleStateChanges","storeKey","withRef"]),C=_+"Subscription",j=O++,E=(e={},e[_]=P.default,e[C]=h.PropTypes.instanceOf(v.default),e),q=(n={},n[C]=h.PropTypes.instanceOf(v.default),n);return function(e){(0,l.default)("function"==typeof e,"You must pass a component to the function returned by connect. Instead received "+e);var n=e.displayName||e.name||"Component",r=c(n),u=p({},x,{getDisplayName:c,methodName:y,renderCountProp:m,shouldHandleStateChanges:g,storeKey:_,withRef:T,displayName:r,WrappedComponent:e}),a=function(n){function a(t,e){o(this,a);var s=i(this,n.call(this,t,e));return s.version=j,s.state={},s.renderCount=0,s.store=s.props[_]||s.context[_],s.parentSub=s.props[C]||s.context[C],s.setWrappedInstance=s.setWrappedInstance.bind(s),(0,l.default)(s.store,'Could not find "'+_+'" in either the context or '+('props of "'+r+'". ')+"Either wrap the root component in a <Provider>, "+('or explicitly pass "'+_+'" as a prop to "'+r+'".')),s.getState=s.store.getState.bind(s.store),s.initSelector(),s.initSubscription(),s}return s(a,n),a.prototype.getChildContext=function(){var t;return t={},t[C]=this.subscription,t},a.prototype.componentDidMount=function(){g&&(this.subscription.trySubscribe(),this.selector.run(this.props),this.selector.shouldComponentUpdate&&this.forceUpdate())},a.prototype.componentWillReceiveProps=function(t){this.selector.run(t)},a.prototype.shouldComponentUpdate=function(){return this.selector.shouldComponentUpdate},a.prototype.componentWillUnmount=function(){this.subscription&&this.subscription.tryUnsubscribe(),this.subscription=null,this.store=null,this.parentSub=null,this.selector.run=function(){}},a.prototype.getWrappedInstance=function(){return(0,l.default)(T,"To access the wrapped instance, you need to specify "+("{ withRef: true } in the options argument of the "+y+"() call.")),this.wrappedInstance},a.prototype.setWrappedInstance=function(t){this.wrappedInstance=t},a.prototype.initSelector=function(){var e=this.store.dispatch,n=this.getState,r=t(e,u),o=this.selector={shouldComponentUpdate:!0,props:r(n(),this.props),run:function(t){try{var e=r(n(),t);(o.error||e!==o.props)&&(o.shouldComponentUpdate=!0,o.props=e,o.error=null)}catch(i){o.shouldComponentUpdate=!0,o.error=i}}}},a.prototype.initSubscription=function(){var t=this;g&&!function(){var e=t.subscription=new v.default(t.store,t.parentSub),n=e.notifyNestedSubs.bind(e),r={};e.onStateChange=function(){this.selector.run(this.props),this.selector.shouldComponentUpdate?this.setState(r,n):e.notifyNestedSubs()}.bind(t)}()},a.prototype.isSubscribed=function(){return!!this.subscription&&this.subscription.isSubscribed()},a.prototype.addExtraProps=function(t){if(!T&&!m)return t;var e=p({},t);return T&&(e.ref=this.setWrappedInstance),m&&(e[m]=this.renderCount++),e},a.prototype.render=function(){var t=this.selector;if(t.shouldComponentUpdate=!1,t.error)throw t.error;return(0,h.createElement)(e,this.addExtraProps(t.props))},a}(h.Component);return a.WrappedComponent=e,a.displayName=r,a.childContextTypes=q,a.contextTypes=E,a.propTypes=E,(0,f.default)(a,e)}}e.__esModule=!0;var p=Object.assign||function(t){for(var e=1;arguments.length>e;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t};e.default=a;var c=n(16),f=r(c),d=n(17),l=r(d),h=n(2),y=n(14),v=r(y),b=n(5),P=r(b),O=0},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{"default":t}}function o(t){return function(e,n){function r(){return o}var o=t(e,n);return r.dependsOnOwnProps=!1,r}}function i(t){return null!==t.dependsOnOwnProps&&void 0!==t.dependsOnOwnProps?!!t.dependsOnOwnProps:1!==t.length}function s(t,e){return function(e,n){var r=function(t,e){return r.dependsOnOwnProps?r.mapToProps(t,e):r.mapToProps(t)};return r.dependsOnOwnProps=i(t),r.mapToProps=function(e,n){r.mapToProps=t;var o=r(e,n);return"function"==typeof o&&(r.mapToProps=o,r.dependsOnOwnProps=i(o),o=r(e,n)),o},r}}e.__esModule=!0,e.wrapMapToPropsConstant=o,e.getDependsOnOwnProps=i,e.wrapMapToPropsFunc=s;var u=n(6);r(u)},function(t,e,n){"use strict";e.__esModule=!0;var r=n(2);e.default=r.PropTypes.shape({subscribe:r.PropTypes.func.isRequired,dispatch:r.PropTypes.func.isRequired,getState:r.PropTypes.func.isRequired})},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{"default":t}}function o(t,e,n){(0,s.default)(t)||(0,a.default)(n+"() in "+e+" must return a plain object. Instead received "+t+".")}e.__esModule=!0,e.default=o;var i=n(21),s=r(i),u=n(1),a=r(u)},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{"default":t}}function o(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function i(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function s(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}e.__esModule=!0,e.default=void 0;var u=n(2),a=n(5),p=r(a),c=n(1),f=(r(c),function(t){function e(n,r){o(this,e);var s=i(this,t.call(this,n,r));return s.store=n.store,s}return s(e,t),e.prototype.getChildContext=function(){return{store:this.store}},e.prototype.render=function(){return u.Children.only(this.props.children)},e}(u.Component));e.default=f,f.propTypes={store:p.default.isRequired,children:u.PropTypes.element.isRequired},f.childContextTypes={store:p.default.isRequired},f.displayName="Provider"},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{"default":t}}function o(t,e){var n={};for(var r in t)e.indexOf(r)<0&&Object.prototype.hasOwnProperty.call(t,r)&&(n[r]=t[r]);return n}function i(t,e){for(var n=e.length-1;n>=0;n--){var r=e[n](t);if(r)return r}}function s(t,e){return t===e}function u(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=t.connectHOC,n=void 0===e?c.default:e,r=t.mapStateToPropsFactories,u=void 0===r?v.default:r,p=t.mapDispatchToPropsFactories,f=void 0===p?h.default:p,l=t.mergePropsFactories,y=void 0===l?P.default:l,b=t.selectorFactory,O=void 0===b?m.default:b;return function(t,e,r){var p=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},c=p.pure,l=void 0===c||c,h=p.areStatesEqual,v=void 0===h?s:h,b=p.areOwnPropsEqual,P=void 0===b?d.default:b,m=p.areStatePropsEqual,w=void 0===m?d.default:m,g=p.areMergedPropsEqual,M=void 0===g?d.default:g,_=o(p,["pure","areStatesEqual","areOwnPropsEqual","areStatePropsEqual","areMergedPropsEqual"]),S=i(t,u),T=i(e,f),x=i(r,y);return n(O,a({methodName:"connect",getDisplayName:function(t){return"Connect("+t+")"},shouldHandleStateChanges:!!t,initMapStateToProps:S,initMapDispatchToProps:T,initMergeProps:x,pure:l,areStatesEqual:v,areOwnPropsEqual:P,areStatePropsEqual:w,areMergedPropsEqual:M},_))}}e.__esModule=!0;var a=Object.assign||function(t){for(var e=1;arguments.length>e;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t};e.createConnect=u;var p=n(3),c=r(p),f=n(15),d=r(f),l=n(9),h=r(l),y=n(10),v=r(y),b=n(11),P=r(b),O=n(12),m=r(O);e.default=u()},function(t,e,n){"use strict";function r(t){return"function"==typeof t?(0,u.wrapMapToPropsFunc)(t,"mapDispatchToProps"):void 0}function o(t){return t?void 0:(0,u.wrapMapToPropsConstant)(function(t){return{dispatch:t}})}function i(t){return t&&"object"==typeof t?(0,u.wrapMapToPropsConstant)(function(e){return(0,s.bindActionCreators)(t,e)}):void 0}e.__esModule=!0,e.whenMapDispatchToPropsIsFunction=r,e.whenMapDispatchToPropsIsMissing=o,e.whenMapDispatchToPropsIsObject=i;var s=n(22),u=n(4);e.default=[r,o,i]},function(t,e,n){"use strict";function r(t){return"function"==typeof t?(0,i.wrapMapToPropsFunc)(t,"mapStateToProps"):void 0}function o(t){return t?void 0:(0,i.wrapMapToPropsConstant)(function(){return{}})}e.__esModule=!0,e.whenMapStateToPropsIsFunction=r,e.whenMapStateToPropsIsMissing=o;var i=n(4);e.default=[r,o]},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{"default":t}}function o(t,e,n){return a({},n,t,e)}function i(t){return function(e,n){var r=n.pure,o=n.areMergedPropsEqual,i=!1,s=void 0;return function(e,n,u){var a=t(e,n,u);return i?r&&o(a,s)||(s=a):(i=!0,s=a),s}}}function s(t){return"function"==typeof t?i(t):void 0}function u(t){return t?void 0:function(){return o}}e.__esModule=!0;var a=Object.assign||function(t){for(var e=1;arguments.length>e;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t};e.defaultMergeProps=o,e.wrapMergePropsFunc=i,e.whenMergePropsIsFunction=s,e.whenMergePropsIsOmitted=u;var p=n(6);r(p);e.default=[s,u]},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{"default":t}}function o(t,e){var n={};for(var r in t)e.indexOf(r)<0&&Object.prototype.hasOwnProperty.call(t,r)&&(n[r]=t[r]);return n}function i(t,e,n,r){return function(o,i){return n(t(o,i),e(r,i),i)}}function s(t,e,n,r,o){function i(o,i){return h=o,y=i,v=t(h,y),b=e(r,y),P=n(v,b,y),l=!0,P}function s(){return v=t(h,y),e.dependsOnOwnProps&&(b=e(r,y)),P=n(v,b,y)}function u(){return t.dependsOnOwnProps&&(v=t(h,y)),e.dependsOnOwnProps&&(b=e(r,y)),P=n(v,b,y)}function a(){var e=t(h,y),r=!d(e,v);return v=e,r&&(P=n(v,b,y)),P}function p(t,e){var n=!f(e,y),r=!c(t,h);return h=t,y=e,n&&r?s():n?u():r?a():P}var c=o.areStatesEqual,f=o.areOwnPropsEqual,d=o.areStatePropsEqual,l=!1,h=void 0,y=void 0,v=void 0,b=void 0,P=void 0;return function(t,e){return l?p(t,e):i(t,e)}}function u(t,e){var n=e.initMapStateToProps,r=e.initMapDispatchToProps,u=e.initMergeProps,a=o(e,["initMapStateToProps","initMapDispatchToProps","initMergeProps"]),p=n(t,a),c=r(t,a),f=u(t,a),d=a.pure?s:i;return d(p,c,f,t,a)}e.__esModule=!0,e.impureFinalPropsSelectorFactory=i,e.pureFinalPropsSelectorFactory=s,e.default=u;var a=n(13);r(a)},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{"default":t}}function o(t,e,n){if(!t)throw Error("Unexpected value for "+e+" in "+n+".");"mapStateToProps"!==e&&"mapDispatchToProps"!==e||t.hasOwnProperty("dependsOnOwnProps")||(0,u.default)("The selector for "+e+" of "+n+" did not specify a value for dependsOnOwnProps.")}function i(t,e,n,r){o(t,"mapStateToProps",r),o(e,"mapDispatchToProps",r),o(n,"mergeProps",r)}e.__esModule=!0,e.default=i;var s=n(1),u=r(s)},function(t,e){"use strict";function n(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function r(){var t=[],e=[];return{clear:function(){e=o,t=o},notify:function(){t=e;for(var n=0;t.length>n;n++)t[n]()},subscribe:function(n){var r=!0;return e===t&&(e=t.slice()),e.push(n),function(){r&&t!==o&&(r=!1,e===t&&(e=t.slice()),e.splice(e.indexOf(n),1))}}}}e.__esModule=!0;var o=null,i=function(){function t(e,o){n(this,t),this.subscribe=o?o.addNestedSub.bind(o):e.subscribe.bind(e),this.unsubscribe=null,this.listeners=r()}return t.prototype.addNestedSub=function(t){return this.trySubscribe(),this.listeners.subscribe(t)},t.prototype.notifyNestedSubs=function(){this.listeners.notify()},t.prototype.isSubscribed=function(){return!!this.unsubscribe},t.prototype.trySubscribe=function(){this.unsubscribe||(this.unsubscribe=this.subscribe(this.onStateChange))},t.prototype.tryUnsubscribe=function(){this.unsubscribe&&(this.unsubscribe(),this.listeners.clear()),this.unsubscribe=null,this.subscribe=null,this.listeners={notify:function(){}}},t}();e.default=i},function(t,e){"use strict";function n(t,e){if(t===e)return!0;var n=0,o=0;for(var i in t){if(r.call(t,i)&&t[i]!==e[i])return!1;n++}for(var s in e)r.call(e,s)&&o++;return n===o}e.__esModule=!0,e.default=n;var r=Object.prototype.hasOwnProperty},function(t,e){"use strict";var n={childContextTypes:!0,contextTypes:!0,defaultProps:!0,displayName:!0,getDefaultProps:!0,mixins:!0,propTypes:!0,type:!0},r={name:!0,length:!0,prototype:!0,caller:!0,arguments:!0,arity:!0},o="function"==typeof Object.getOwnPropertySymbols;t.exports=function(t,e,i){if("string"!=typeof e){var s=Object.getOwnPropertyNames(e);o&&(s=s.concat(Object.getOwnPropertySymbols(e)));for(var u=0;s.length>u;++u)if(!(n[s[u]]||r[s[u]]||i&&i[s[u]]))try{t[s[u]]=e[s[u]]}catch(a){}}return t}},function(t,e,n){"use strict";var r=function(t,e,n,r,o,i,s,u){if(!t){var a;if(void 0===e)a=Error("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{var p=[n,r,o,i,s,u],c=0;a=Error(e.replace(/%s/g,function(){return p[c++]})),a.name="Invariant Violation"}throw a.framesToPop=1,a}};t.exports=r},function(t,e,n){var r=n(19),o=r(Object.getPrototypeOf,Object);t.exports=o},function(t,e){function n(t,e){return function(n){return t(e(n))}}t.exports=n},function(t,e){function n(t){return null!=t&&"object"==typeof t}t.exports=n},function(t,e,n){function r(t){if(!i(t)||d.call(t)!=s)return!1;var e=o(t);if(null===e)return!0;var n=c.call(e,"constructor")&&e.constructor;return"function"==typeof n&&n instanceof n&&p.call(n)==f}var o=n(18),i=n(20),s="[object Object]",u=Function.prototype,a=Object.prototype,p=u.toString,c=a.hasOwnProperty,f=p.call(Object),d=a.toString;t.exports=r},function(t,n){t.exports=e}])}); | ||
!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e(require("react"),require("redux")):"function"==typeof define&&define.amd?define(["react","redux"],e):"object"==typeof exports?exports.ReactRedux=e(require("react"),require("redux")):t.ReactRedux=e(t.React,t.Redux)}(this,function(t,e){return function(t){function e(r){if(n[r])return n[r].exports;var o=n[r]={exports:{},id:r,loaded:!1};return t[r].call(o.exports,o,o.exports,e),o.loaded=!0,o.exports}var n={};return e.m=t,e.c=n,e.p="",e(0)}([function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{default:t}}e.__esModule=!0,e.connect=e.connectAdvanced=e.Provider=void 0;var o=n(8),i=r(o),u=n(3),s=r(u),a=n(9),p=r(a);e.Provider=i.default,e.connectAdvanced=s.default,e.connect=p.default},function(t,e){"use strict";function n(t){"undefined"!=typeof console&&"function"==typeof console.error&&console.error(t);try{throw Error(t)}catch(t){}}e.__esModule=!0,e.default=n},function(e,n){e.exports=t},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{default:t}}function o(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function i(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function u(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}function s(t,e){var n={};for(var r in t)e.indexOf(r)<0&&Object.prototype.hasOwnProperty.call(t,r)&&(n[r]=t[r]);return n}function a(t){var e,n,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},a=r.getDisplayName,c=void 0===a?function(t){return"ConnectAdvanced("+t+")"}:a,l=r.methodName,y=void 0===l?"connectAdvanced":l,b=r.react15CompatibilityMode,w=void 0===b?void 0:b,g=r.renderCountProp,M=void 0===g?void 0:g,S=r.shouldHandleStateChanges,T=void 0===S||S,_=r.storeKey,C=void 0===_?"store":_,x=r.withRef,j=void 0!==x&&x,E=s(r,["getDisplayName","methodName","react15CompatibilityMode","renderCountProp","shouldHandleStateChanges","storeKey","withRef"]),q=C+"Subscription",N=O++,R=(e={},e[C]=P.default,e[q]=h.PropTypes.instanceOf(v.default),e.react15CompatibilityMode=h.PropTypes.bool,e),D=(n={},n[q]=h.PropTypes.instanceOf(v.default),n);return function(e){(0,d.default)("function"==typeof e,"You must pass a component to the function returned by connect. Instead received "+e);var n=e.displayName||e.name||"Component",r=c(n),s=p({},E,{getDisplayName:c,methodName:y,renderCountProp:M,shouldHandleStateChanges:T,storeKey:C,withRef:j,displayName:r,wrappedComponentName:n,WrappedComponent:e}),a=function(n){function a(t,e){o(this,a);var u=i(this,n.call(this,t,e));u.version=N,u.state={},u.renderCount=0,u.store=u.props[C]||u.context[C];var s=[w,t.react15CompatibilityMode,e.react15CompatibilityMode,m].find(function(t){return void 0!==t&&null!==t});return u.parentSub=s?null:t[q]||e[q],u.setWrappedInstance=u.setWrappedInstance.bind(u),(0,d.default)(u.store,'Could not find "'+C+'" in either the context or '+('props of "'+r+'". ')+"Either wrap the root component in a <Provider>, "+('or explicitly pass "'+C+'" as a prop to "'+r+'".')),u.getState=u.store.getState.bind(u.store),u.initSelector(),u.initSubscription(),u}return u(a,n),a.prototype.getChildContext=function(){var t;return t={},t[q]=this.subscription,t},a.prototype.componentDidMount=function(){T&&(this.subscription.trySubscribe(),this.selector.run(this.props),this.selector.shouldComponentUpdate&&this.forceUpdate())},a.prototype.componentWillReceiveProps=function(t){this.selector.run(t)},a.prototype.shouldComponentUpdate=function(){return this.selector.shouldComponentUpdate},a.prototype.componentWillUnmount=function(){this.subscription&&this.subscription.tryUnsubscribe(),this.subscription=null,this.store=null,this.parentSub=null,this.selector.run=function(){}},a.prototype.getWrappedInstance=function(){return(0,d.default)(j,"To access the wrapped instance, you need to specify "+("{ withRef: true } in the options argument of the "+y+"() call.")),this.wrappedInstance},a.prototype.setWrappedInstance=function(t){this.wrappedInstance=t},a.prototype.initSelector=function(){var e=this.store.dispatch,n=this.getState,r=t(e,s),o=this.selector={shouldComponentUpdate:!0,props:r(n(),this.props),run:function(t){try{var e=r(n(),t);(o.error||e!==o.props)&&(o.shouldComponentUpdate=!0,o.props=e,o.error=null)}catch(t){o.shouldComponentUpdate=!0,o.error=t}}}},a.prototype.initSubscription=function(){var t=this;T&&!function(){var e=t.subscription=new v.default(t.store,t.parentSub),n=e.notifyNestedSubs.bind(e),r={};e.onStateChange=function(){this.selector.run(this.props),this.selector.shouldComponentUpdate?this.setState(r,n):e.notifyNestedSubs()}.bind(t)}()},a.prototype.isSubscribed=function(){return!!this.subscription&&this.subscription.isSubscribed()},a.prototype.addExtraProps=function(t){if(!j&&!M)return t;var e=p({},t);return j&&(e.ref=this.setWrappedInstance),M&&(e[M]=this.renderCount++),e},a.prototype.render=function(){var t=this.selector;if(t.shouldComponentUpdate=!1,t.error)throw t.error;return(0,h.createElement)(e,this.addExtraProps(t.props))},a}(h.Component);return a.WrappedComponent=e,a.displayName=r,a.childContextTypes=D,a.contextTypes=R,a.propTypes=R,(0,f.default)(a,e)}}e.__esModule=!0;var p=Object.assign||function(t){for(var e=1;arguments.length>e;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t};e.default=a;var c=n(17),f=r(c),l=n(18),d=r(l),h=n(2),y=n(15),v=r(y),b=n(5),P=r(b),m=!0,O=0;a.setDefaultReact15CompatibilityMode=function(t){m=t}},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{default:t}}function o(t){return function(e,n){function r(){return o}var o=t(e,n);return r.dependsOnOwnProps=!1,r}}function i(t){return null!==t.dependsOnOwnProps&&void 0!==t.dependsOnOwnProps?!!t.dependsOnOwnProps:1!==t.length}function u(t,e){return function(e,n){var r=function(t,e){return r.dependsOnOwnProps?r.mapToProps(t,e):r.mapToProps(t)};return r.dependsOnOwnProps=i(t),r.mapToProps=function(e,n){r.mapToProps=t;var o=r(e,n);return"function"==typeof o&&(r.mapToProps=o,r.dependsOnOwnProps=i(o),o=r(e,n)),o},r}}e.__esModule=!0,e.wrapMapToPropsConstant=o,e.getDependsOnOwnProps=i,e.wrapMapToPropsFunc=u;var s=n(6);r(s)},function(t,e,n){"use strict";e.__esModule=!0;var r=n(2);e.default=r.PropTypes.shape({subscribe:r.PropTypes.func.isRequired,dispatch:r.PropTypes.func.isRequired,getState:r.PropTypes.func.isRequired})},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{default:t}}function o(t,e,n){(0,u.default)(t)||(0,a.default)(n+"() in "+e+" must return a plain object. Instead received "+t+".")}e.__esModule=!0,e.default=o;var i=n(27),u=r(i),s=n(1),a=r(s)},function(t,e,n){var r=n(25),o=r.Symbol;t.exports=o},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{default:t}}function o(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function i(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function u(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}e.__esModule=!0,e.default=void 0;var s=n(2),a=n(5),p=r(a),c=n(1),f=(r(c),function(t){function e(n,r){o(this,e);var u=i(this,t.call(this,n,r));return u.store=n.store,u}return u(e,t),e.prototype.getChildContext=function(){return{store:this.store}},e.prototype.render=function(){return s.Children.only(this.props.children)},e}(s.Component));e.default=f,f.propTypes={store:p.default.isRequired,children:s.PropTypes.element.isRequired},f.childContextTypes={store:p.default.isRequired},f.displayName="Provider"},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{default:t}}function o(t,e){var n={};for(var r in t)e.indexOf(r)<0&&Object.prototype.hasOwnProperty.call(t,r)&&(n[r]=t[r]);return n}function i(t,e,n){for(var r=e.length-1;r>=0;r--){var o=e[r](t);if(o)return o}return function(e,r){throw Error("Invalid value of type "+typeof t+" for "+n+" argument when connecting component "+r.wrappedComponentName+".")}}function u(t,e){return t===e}function s(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=t.connectHOC,n=void 0===e?c.default:e,r=t.mapStateToPropsFactories,s=void 0===r?v.default:r,p=t.mapDispatchToPropsFactories,f=void 0===p?h.default:p,d=t.mergePropsFactories,y=void 0===d?P.default:d,b=t.selectorFactory,m=void 0===b?O.default:b;return function(t,e,r){var p=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},c=p.pure,d=void 0===c||c,h=p.areStatesEqual,v=void 0===h?u:h,b=p.areOwnPropsEqual,P=void 0===b?l.default:b,O=p.areStatePropsEqual,w=void 0===O?l.default:O,g=p.areMergedPropsEqual,M=void 0===g?l.default:g,S=o(p,["pure","areStatesEqual","areOwnPropsEqual","areStatePropsEqual","areMergedPropsEqual"]),T=i(t,s,"mapStateToProps"),_=i(e,f,"mapDispatchToProps"),C=i(r,y,"mergeProps");return n(m,a({methodName:"connect",getDisplayName:function(t){return"Connect("+t+")"},shouldHandleStateChanges:!!t,initMapStateToProps:T,initMapDispatchToProps:_,initMergeProps:C,pure:d,areStatesEqual:v,areOwnPropsEqual:P,areStatePropsEqual:w,areMergedPropsEqual:M},S))}}e.__esModule=!0;var a=Object.assign||function(t){for(var e=1;arguments.length>e;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t};e.createConnect=s;var p=n(3),c=r(p),f=n(16),l=r(f),d=n(10),h=r(d),y=n(11),v=r(y),b=n(12),P=r(b),m=n(13),O=r(m),w=s();w.setDefaultReact15CompatibilityMode=c.default.setDefaultReact15CompatibilityMode,e.default=w},function(t,e,n){"use strict";function r(t){return"function"==typeof t?(0,s.wrapMapToPropsFunc)(t,"mapDispatchToProps"):void 0}function o(t){return t?void 0:(0,s.wrapMapToPropsConstant)(function(t){return{dispatch:t}})}function i(t){return t&&"object"==typeof t?(0,s.wrapMapToPropsConstant)(function(e){return(0,u.bindActionCreators)(t,e)}):void 0}e.__esModule=!0,e.whenMapDispatchToPropsIsFunction=r,e.whenMapDispatchToPropsIsMissing=o,e.whenMapDispatchToPropsIsObject=i;var u=n(28),s=n(4);e.default=[r,o,i]},function(t,e,n){"use strict";function r(t){return"function"==typeof t?(0,i.wrapMapToPropsFunc)(t,"mapStateToProps"):void 0}function o(t){return t?void 0:(0,i.wrapMapToPropsConstant)(function(){return{}})}e.__esModule=!0,e.whenMapStateToPropsIsFunction=r,e.whenMapStateToPropsIsMissing=o;var i=n(4);e.default=[r,o]},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{default:t}}function o(t,e,n){return a({},n,t,e)}function i(t){return function(e,n){var r=n.pure,o=n.areMergedPropsEqual,i=!1,u=void 0;return function(e,n,s){var a=t(e,n,s);return i?r&&o(a,u)||(u=a):(i=!0,u=a),u}}}function u(t){return"function"==typeof t?i(t):void 0}function s(t){return t?void 0:function(){return o}}e.__esModule=!0;var a=Object.assign||function(t){for(var e=1;arguments.length>e;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t};e.defaultMergeProps=o,e.wrapMergePropsFunc=i,e.whenMergePropsIsFunction=u,e.whenMergePropsIsOmitted=s;var p=n(6);r(p);e.default=[u,s]},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{default:t}}function o(t,e){var n={};for(var r in t)e.indexOf(r)<0&&Object.prototype.hasOwnProperty.call(t,r)&&(n[r]=t[r]);return n}function i(t,e,n,r){return function(o,i){return n(t(o,i),e(r,i),i)}}function u(t,e,n,r,o){function i(o,i){return h=o,y=i,v=t(h,y),b=e(r,y),P=n(v,b,y),d=!0,P}function u(){return v=t(h,y),e.dependsOnOwnProps&&(b=e(r,y)),P=n(v,b,y)}function s(){return t.dependsOnOwnProps&&(v=t(h,y)),e.dependsOnOwnProps&&(b=e(r,y)),P=n(v,b,y)}function a(){var e=t(h,y),r=!l(e,v);return v=e,r&&(P=n(v,b,y)),P}function p(t,e){var n=!f(e,y),r=!c(t,h);return h=t,y=e,n&&r?u():n?s():r?a():P}var c=o.areStatesEqual,f=o.areOwnPropsEqual,l=o.areStatePropsEqual,d=!1,h=void 0,y=void 0,v=void 0,b=void 0,P=void 0;return function(t,e){return d?p(t,e):i(t,e)}}function s(t,e){var n=e.initMapStateToProps,r=e.initMapDispatchToProps,s=e.initMergeProps,a=o(e,["initMapStateToProps","initMapDispatchToProps","initMergeProps"]),p=n(t,a),c=r(t,a),f=s(t,a),l=a.pure?u:i;return l(p,c,f,t,a)}e.__esModule=!0,e.impureFinalPropsSelectorFactory=i,e.pureFinalPropsSelectorFactory=u,e.default=s;var a=n(14);r(a)},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{default:t}}function o(t,e,n){if(!t)throw Error("Unexpected value for "+e+" in "+n+".");"mapStateToProps"!==e&&"mapDispatchToProps"!==e||t.hasOwnProperty("dependsOnOwnProps")||(0,s.default)("The selector for "+e+" of "+n+" did not specify a value for dependsOnOwnProps.")}function i(t,e,n,r){o(t,"mapStateToProps",r),o(e,"mapDispatchToProps",r),o(n,"mergeProps",r)}e.__esModule=!0,e.default=i;var u=n(1),s=r(u)},function(t,e){"use strict";function n(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function r(){var t=[],e=[];return{clear:function(){e=o,t=o},notify:function(){for(var n=t=e,r=0;n.length>r;r++)n[r]()},subscribe:function(n){var r=!0;return e===t&&(e=t.slice()),e.push(n),function(){r&&t!==o&&(r=!1,e===t&&(e=t.slice()),e.splice(e.indexOf(n),1))}}}}e.__esModule=!0;var o=null,i=function(){function t(e,o){n(this,t),this.subscribe=o?o.addNestedSub.bind(o):e.subscribe.bind(e),this.unsubscribe=null,this.listeners=r()}return t.prototype.addNestedSub=function(t){return this.trySubscribe(),this.listeners.subscribe(t)},t.prototype.notifyNestedSubs=function(){this.listeners.notify()},t.prototype.isSubscribed=function(){return!!this.unsubscribe},t.prototype.trySubscribe=function(){this.unsubscribe||(this.unsubscribe=this.subscribe(this.onStateChange))},t.prototype.tryUnsubscribe=function(){this.unsubscribe&&(this.unsubscribe(),this.listeners.clear()),this.unsubscribe=null,this.subscribe=null,this.listeners={notify:function(){}}},t}();e.default=i},function(t,e){"use strict";function n(t,e){if(t===e)return!0;var n=0,o=0;for(var i in t){if(r.call(t,i)&&t[i]!==e[i])return!1;n++}for(var u in e)r.call(e,u)&&o++;return n===o}e.__esModule=!0,e.default=n;var r=Object.prototype.hasOwnProperty},function(t,e){"use strict";var n={childContextTypes:!0,contextTypes:!0,defaultProps:!0,displayName:!0,getDefaultProps:!0,mixins:!0,propTypes:!0,type:!0},r={name:!0,length:!0,prototype:!0,caller:!0,arguments:!0,arity:!0},o="function"==typeof Object.getOwnPropertySymbols;t.exports=function(t,e,i){if("string"!=typeof e){var u=Object.getOwnPropertyNames(e);o&&(u=u.concat(Object.getOwnPropertySymbols(e)));for(var s=0;u.length>s;++s)if(!(n[u[s]]||r[u[s]]||i&&i[u[s]]))try{t[u[s]]=e[u[s]]}catch(t){}}return t}},function(t,e,n){"use strict";var r=function(t,e,n,r,o,i,u,s){if(!t){var a;if(void 0===e)a=Error("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{var p=[n,r,o,i,u,s],c=0;a=Error(e.replace(/%s/g,function(){return p[c++]})),a.name="Invariant Violation"}throw a.framesToPop=1,a}};t.exports=r},function(t,e,n){function r(t){return null==t?void 0===t?a:s:(t=Object(t),p&&p in t?i(t):u(t))}var o=n(7),i=n(22),u=n(23),s="[object Null]",a="[object Undefined]",p=o?o.toStringTag:void 0;t.exports=r},function(t,e){(function(e){var n="object"==typeof e&&e&&e.Object===Object&&e;t.exports=n}).call(e,function(){return this}()||Function("return this")())},function(t,e,n){var r=n(24),o=r(Object.getPrototypeOf,Object);t.exports=o},function(t,e,n){function r(t){var e=u.call(t,a),n=t[a];try{t[a]=void 0;var r=!0}catch(t){}var o=s.call(t);return r&&(e?t[a]=n:delete t[a]),o}var o=n(7),i=Object.prototype,u=i.hasOwnProperty,s=i.toString,a=o?o.toStringTag:void 0;t.exports=r},function(t,e){function n(t){return o.call(t)}var r=Object.prototype,o=r.toString;t.exports=n},function(t,e){function n(t,e){return function(n){return t(e(n))}}t.exports=n},function(t,e,n){var r=n(20),o="object"==typeof self&&self&&self.Object===Object&&self,i=r||o||Function("return this")();t.exports=i},function(t,e){function n(t){return null!=t&&"object"==typeof t}t.exports=n},function(t,e,n){function r(t){if(!u(t)||o(t)!=s)return!1;var e=i(t);if(null===e)return!0;var n=f.call(e,"constructor")&&e.constructor;return"function"==typeof n&&n instanceof n&&c.call(n)==l}var o=n(19),i=n(21),u=n(26),s="[object Object]",a=Function.prototype,p=Object.prototype,c=a.toString,f=p.hasOwnProperty,l=c.call(Object);t.exports=r},function(t,n){t.exports=e}])}); |
@@ -18,2 +18,3 @@ var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; | ||
var defaultReact15CompatibilityMode = true; | ||
var hotReloadingVersion = 0; | ||
@@ -30,3 +31,3 @@ export default function connectAdvanced( | ||
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. | ||
the selectorFactory, along with displayName and WrappedComponent, as the second argument. | ||
Note that selectorFactory is responsible for all caching/memoization of inbound and outbound | ||
@@ -39,25 +40,25 @@ props. Do not use connectAdvanced directly without memoizing results between calls to your | ||
var _ref = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; | ||
var _ref$getDisplayName = _ref.getDisplayName; | ||
var getDisplayName = _ref$getDisplayName === undefined ? function (name) { | ||
var _ref = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}, | ||
_ref$getDisplayName = _ref.getDisplayName, | ||
getDisplayName = _ref$getDisplayName === undefined ? function (name) { | ||
return 'ConnectAdvanced(' + name + ')'; | ||
} : _ref$getDisplayName; | ||
var _ref$methodName = _ref.methodName; | ||
var methodName = _ref$methodName === undefined ? 'connectAdvanced' : _ref$methodName; | ||
var _ref$renderCountProp = _ref.renderCountProp; | ||
var renderCountProp = _ref$renderCountProp === undefined ? undefined : _ref$renderCountProp; | ||
var _ref$shouldHandleStat = _ref.shouldHandleStateChanges; | ||
var shouldHandleStateChanges = _ref$shouldHandleStat === undefined ? true : _ref$shouldHandleStat; | ||
var _ref$storeKey = _ref.storeKey; | ||
var storeKey = _ref$storeKey === undefined ? 'store' : _ref$storeKey; | ||
var _ref$withRef = _ref.withRef; | ||
var withRef = _ref$withRef === undefined ? false : _ref$withRef; | ||
} : _ref$getDisplayName, | ||
_ref$methodName = _ref.methodName, | ||
methodName = _ref$methodName === undefined ? 'connectAdvanced' : _ref$methodName, | ||
_ref$react15Compatibi = _ref.react15CompatibilityMode, | ||
react15CompatibilityMode = _ref$react15Compatibi === undefined ? undefined : _ref$react15Compatibi, | ||
_ref$renderCountProp = _ref.renderCountProp, | ||
renderCountProp = _ref$renderCountProp === undefined ? undefined : _ref$renderCountProp, | ||
_ref$shouldHandleStat = _ref.shouldHandleStateChanges, | ||
shouldHandleStateChanges = _ref$shouldHandleStat === undefined ? true : _ref$shouldHandleStat, | ||
_ref$storeKey = _ref.storeKey, | ||
storeKey = _ref$storeKey === undefined ? 'store' : _ref$storeKey, | ||
_ref$withRef = _ref.withRef, | ||
withRef = _ref$withRef === undefined ? false : _ref$withRef, | ||
connectOptions = _objectWithoutProperties(_ref, ['getDisplayName', 'methodName', 'react15CompatibilityMode', 'renderCountProp', 'shouldHandleStateChanges', 'storeKey', 'withRef']); | ||
var connectOptions = _objectWithoutProperties(_ref, ['getDisplayName', 'methodName', 'renderCountProp', 'shouldHandleStateChanges', 'storeKey', 'withRef']); | ||
var subscriptionKey = storeKey + 'Subscription'; | ||
var version = hotReloadingVersion++; | ||
var contextTypes = (_contextTypes = {}, _contextTypes[storeKey] = storeShape, _contextTypes[subscriptionKey] = PropTypes.instanceOf(Subscription), _contextTypes); | ||
var contextTypes = (_contextTypes = {}, _contextTypes[storeKey] = storeShape, _contextTypes[subscriptionKey] = PropTypes.instanceOf(Subscription), _contextTypes.react15CompatibilityMode = PropTypes.bool, _contextTypes); | ||
var childContextTypes = (_childContextTypes = {}, _childContextTypes[subscriptionKey] = PropTypes.instanceOf(Subscription), _childContextTypes); | ||
@@ -80,2 +81,3 @@ | ||
displayName: displayName, | ||
wrappedComponentName: wrappedComponentName, | ||
WrappedComponent: WrappedComponent | ||
@@ -96,3 +98,12 @@ }); | ||
_this.store = _this.props[storeKey] || _this.context[storeKey]; | ||
_this.parentSub = _this.props[subscriptionKey] || _this.context[subscriptionKey]; | ||
// react15CompatibilityMode controls whether the subscription system is used. This is for | ||
// https://github.com/reactjs/react-redux/issues/525 and should be removed completely when | ||
// react-redux's dependency on react is bumped to mimimum v16, which is expected to include | ||
// PR https://github.com/facebook/react/pull/8204 which fixes the issue. | ||
var compatMode = [react15CompatibilityMode, props.react15CompatibilityMode, context.react15CompatibilityMode, defaultReact15CompatibilityMode].find(function (cm) { | ||
return cm !== undefined && cm !== null; | ||
}); | ||
_this.parentSub = compatMode ? null : props[subscriptionKey] || context[subscriptionKey]; | ||
_this.setWrappedInstance = _this.setWrappedInstance.bind(_this); | ||
@@ -258,2 +269,6 @@ | ||
}; | ||
} | ||
} | ||
connectAdvanced.setDefaultReact15CompatibilityMode = function setDefaultReact15CompatibilityMode(compat) { | ||
defaultReact15CompatibilityMode = compat; | ||
}; |
@@ -29,3 +29,3 @@ var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; | ||
function match(arg, factories) { | ||
function match(arg, factories, name) { | ||
for (var i = factories.length - 1; i >= 0; i--) { | ||
@@ -35,3 +35,6 @@ var result = factories[i](arg); | ||
} | ||
return undefined; | ||
return function (dispatch, options) { | ||
throw new Error('Invalid value of type ' + typeof arg + ' for ' + name + ' argument when connecting component ' + options.wrappedComponentName + '.'); | ||
}; | ||
} | ||
@@ -46,35 +49,32 @@ | ||
export function createConnect() { | ||
var _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; | ||
var _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}, | ||
_ref$connectHOC = _ref.connectHOC, | ||
connectHOC = _ref$connectHOC === undefined ? connectAdvanced : _ref$connectHOC, | ||
_ref$mapStateToPropsF = _ref.mapStateToPropsFactories, | ||
mapStateToPropsFactories = _ref$mapStateToPropsF === undefined ? defaultMapStateToPropsFactories : _ref$mapStateToPropsF, | ||
_ref$mapDispatchToPro = _ref.mapDispatchToPropsFactories, | ||
mapDispatchToPropsFactories = _ref$mapDispatchToPro === undefined ? defaultMapDispatchToPropsFactories : _ref$mapDispatchToPro, | ||
_ref$mergePropsFactor = _ref.mergePropsFactories, | ||
mergePropsFactories = _ref$mergePropsFactor === undefined ? defaultMergePropsFactories : _ref$mergePropsFactor, | ||
_ref$selectorFactory = _ref.selectorFactory, | ||
selectorFactory = _ref$selectorFactory === undefined ? defaultSelectorFactory : _ref$selectorFactory; | ||
var _ref$connectHOC = _ref.connectHOC; | ||
var connectHOC = _ref$connectHOC === undefined ? connectAdvanced : _ref$connectHOC; | ||
var _ref$mapStateToPropsF = _ref.mapStateToPropsFactories; | ||
var mapStateToPropsFactories = _ref$mapStateToPropsF === undefined ? defaultMapStateToPropsFactories : _ref$mapStateToPropsF; | ||
var _ref$mapDispatchToPro = _ref.mapDispatchToPropsFactories; | ||
var mapDispatchToPropsFactories = _ref$mapDispatchToPro === undefined ? defaultMapDispatchToPropsFactories : _ref$mapDispatchToPro; | ||
var _ref$mergePropsFactor = _ref.mergePropsFactories; | ||
var mergePropsFactories = _ref$mergePropsFactor === undefined ? defaultMergePropsFactories : _ref$mergePropsFactor; | ||
var _ref$selectorFactory = _ref.selectorFactory; | ||
var selectorFactory = _ref$selectorFactory === undefined ? defaultSelectorFactory : _ref$selectorFactory; | ||
return function connect(mapStateToProps, mapDispatchToProps, mergeProps) { | ||
var _ref2 = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {}; | ||
var _ref2 = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {}, | ||
_ref2$pure = _ref2.pure, | ||
pure = _ref2$pure === undefined ? true : _ref2$pure, | ||
_ref2$areStatesEqual = _ref2.areStatesEqual, | ||
areStatesEqual = _ref2$areStatesEqual === undefined ? strictEqual : _ref2$areStatesEqual, | ||
_ref2$areOwnPropsEqua = _ref2.areOwnPropsEqual, | ||
areOwnPropsEqual = _ref2$areOwnPropsEqua === undefined ? shallowEqual : _ref2$areOwnPropsEqua, | ||
_ref2$areStatePropsEq = _ref2.areStatePropsEqual, | ||
areStatePropsEqual = _ref2$areStatePropsEq === undefined ? shallowEqual : _ref2$areStatePropsEq, | ||
_ref2$areMergedPropsE = _ref2.areMergedPropsEqual, | ||
areMergedPropsEqual = _ref2$areMergedPropsE === undefined ? shallowEqual : _ref2$areMergedPropsE, | ||
extraOptions = _objectWithoutProperties(_ref2, ['pure', 'areStatesEqual', 'areOwnPropsEqual', 'areStatePropsEqual', 'areMergedPropsEqual']); | ||
var _ref2$pure = _ref2.pure; | ||
var pure = _ref2$pure === undefined ? true : _ref2$pure; | ||
var _ref2$areStatesEqual = _ref2.areStatesEqual; | ||
var areStatesEqual = _ref2$areStatesEqual === undefined ? strictEqual : _ref2$areStatesEqual; | ||
var _ref2$areOwnPropsEqua = _ref2.areOwnPropsEqual; | ||
var areOwnPropsEqual = _ref2$areOwnPropsEqua === undefined ? shallowEqual : _ref2$areOwnPropsEqua; | ||
var _ref2$areStatePropsEq = _ref2.areStatePropsEqual; | ||
var areStatePropsEqual = _ref2$areStatePropsEq === undefined ? shallowEqual : _ref2$areStatePropsEq; | ||
var _ref2$areMergedPropsE = _ref2.areMergedPropsEqual; | ||
var areMergedPropsEqual = _ref2$areMergedPropsE === undefined ? shallowEqual : _ref2$areMergedPropsE; | ||
var initMapStateToProps = match(mapStateToProps, mapStateToPropsFactories, 'mapStateToProps'); | ||
var initMapDispatchToProps = match(mapDispatchToProps, mapDispatchToPropsFactories, 'mapDispatchToProps'); | ||
var initMergeProps = match(mergeProps, mergePropsFactories, 'mergeProps'); | ||
var extraOptions = _objectWithoutProperties(_ref2, ['pure', 'areStatesEqual', 'areOwnPropsEqual', 'areStatePropsEqual', 'areMergedPropsEqual']); | ||
var initMapStateToProps = match(mapStateToProps, mapStateToPropsFactories); | ||
var initMapDispatchToProps = match(mapDispatchToProps, mapDispatchToPropsFactories); | ||
var initMergeProps = match(mergeProps, mergePropsFactories); | ||
return connectHOC(selectorFactory, _extends({ | ||
@@ -106,2 +106,4 @@ // used in error messages | ||
export default createConnect(); | ||
var connect = createConnect(); | ||
connect.setDefaultReact15CompatibilityMode = connectAdvanced.setDefaultReact15CompatibilityMode; | ||
export default connect; |
@@ -11,5 +11,5 @@ var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; | ||
return function initMergePropsProxy(dispatch, _ref) { | ||
var displayName = _ref.displayName; | ||
var pure = _ref.pure; | ||
var areMergedPropsEqual = _ref.areMergedPropsEqual; | ||
var displayName = _ref.displayName, | ||
pure = _ref.pure, | ||
areMergedPropsEqual = _ref.areMergedPropsEqual; | ||
@@ -16,0 +16,0 @@ var hasRunOnce = false; |
@@ -12,5 +12,5 @@ function _objectWithoutProperties(obj, keys) { var target = {}; for (var i in obj) { if (keys.indexOf(i) >= 0) continue; if (!Object.prototype.hasOwnProperty.call(obj, i)) continue; target[i] = obj[i]; } return target; } | ||
export function pureFinalPropsSelectorFactory(mapStateToProps, mapDispatchToProps, mergeProps, dispatch, _ref) { | ||
var areStatesEqual = _ref.areStatesEqual; | ||
var areOwnPropsEqual = _ref.areOwnPropsEqual; | ||
var areStatePropsEqual = _ref.areStatePropsEqual; | ||
var areStatesEqual = _ref.areStatesEqual, | ||
areOwnPropsEqual = _ref.areOwnPropsEqual, | ||
areStatePropsEqual = _ref.areStatePropsEqual; | ||
@@ -87,8 +87,7 @@ var hasRunAtLeastOnce = false; | ||
export default function finalPropsSelectorFactory(dispatch, _ref2) { | ||
var initMapStateToProps = _ref2.initMapStateToProps; | ||
var initMapDispatchToProps = _ref2.initMapDispatchToProps; | ||
var initMergeProps = _ref2.initMergeProps; | ||
var initMapStateToProps = _ref2.initMapStateToProps, | ||
initMapDispatchToProps = _ref2.initMapDispatchToProps, | ||
initMergeProps = _ref2.initMergeProps, | ||
options = _objectWithoutProperties(_ref2, ['initMapStateToProps', 'initMapDispatchToProps', 'initMergeProps']); | ||
var options = _objectWithoutProperties(_ref2, ['initMapStateToProps', 'initMapDispatchToProps', 'initMergeProps']); | ||
var mapStateToProps = initMapStateToProps(dispatch, options); | ||
@@ -95,0 +94,0 @@ var mapDispatchToProps = initMapDispatchToProps(dispatch, options); |
@@ -21,5 +21,5 @@ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } | ||
notify: function notify() { | ||
current = next; | ||
for (var i = 0; i < current.length; i++) { | ||
current[i](); | ||
var listeners = current = next; | ||
for (var i = 0; i < listeners.length; i++) { | ||
listeners[i](); | ||
} | ||
@@ -26,0 +26,0 @@ }, |
@@ -37,2 +37,3 @@ 'use strict'; | ||
var defaultReact15CompatibilityMode = true; | ||
var hotReloadingVersion = 0; | ||
@@ -49,3 +50,3 @@ function connectAdvanced( | ||
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. | ||
the selectorFactory, along with displayName and WrappedComponent, as the second argument. | ||
Note that selectorFactory is responsible for all caching/memoization of inbound and outbound | ||
@@ -58,25 +59,25 @@ props. Do not use connectAdvanced directly without memoizing results between calls to your | ||
var _ref = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; | ||
var _ref$getDisplayName = _ref.getDisplayName; | ||
var getDisplayName = _ref$getDisplayName === undefined ? function (name) { | ||
var _ref = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}, | ||
_ref$getDisplayName = _ref.getDisplayName, | ||
getDisplayName = _ref$getDisplayName === undefined ? function (name) { | ||
return 'ConnectAdvanced(' + name + ')'; | ||
} : _ref$getDisplayName; | ||
var _ref$methodName = _ref.methodName; | ||
var methodName = _ref$methodName === undefined ? 'connectAdvanced' : _ref$methodName; | ||
var _ref$renderCountProp = _ref.renderCountProp; | ||
var renderCountProp = _ref$renderCountProp === undefined ? undefined : _ref$renderCountProp; | ||
var _ref$shouldHandleStat = _ref.shouldHandleStateChanges; | ||
var shouldHandleStateChanges = _ref$shouldHandleStat === undefined ? true : _ref$shouldHandleStat; | ||
var _ref$storeKey = _ref.storeKey; | ||
var storeKey = _ref$storeKey === undefined ? 'store' : _ref$storeKey; | ||
var _ref$withRef = _ref.withRef; | ||
var withRef = _ref$withRef === undefined ? false : _ref$withRef; | ||
} : _ref$getDisplayName, | ||
_ref$methodName = _ref.methodName, | ||
methodName = _ref$methodName === undefined ? 'connectAdvanced' : _ref$methodName, | ||
_ref$react15Compatibi = _ref.react15CompatibilityMode, | ||
react15CompatibilityMode = _ref$react15Compatibi === undefined ? undefined : _ref$react15Compatibi, | ||
_ref$renderCountProp = _ref.renderCountProp, | ||
renderCountProp = _ref$renderCountProp === undefined ? undefined : _ref$renderCountProp, | ||
_ref$shouldHandleStat = _ref.shouldHandleStateChanges, | ||
shouldHandleStateChanges = _ref$shouldHandleStat === undefined ? true : _ref$shouldHandleStat, | ||
_ref$storeKey = _ref.storeKey, | ||
storeKey = _ref$storeKey === undefined ? 'store' : _ref$storeKey, | ||
_ref$withRef = _ref.withRef, | ||
withRef = _ref$withRef === undefined ? false : _ref$withRef, | ||
connectOptions = _objectWithoutProperties(_ref, ['getDisplayName', 'methodName', 'react15CompatibilityMode', 'renderCountProp', 'shouldHandleStateChanges', 'storeKey', 'withRef']); | ||
var connectOptions = _objectWithoutProperties(_ref, ['getDisplayName', 'methodName', 'renderCountProp', 'shouldHandleStateChanges', 'storeKey', 'withRef']); | ||
var subscriptionKey = storeKey + 'Subscription'; | ||
var version = hotReloadingVersion++; | ||
var contextTypes = (_contextTypes = {}, _contextTypes[storeKey] = _storeShape2.default, _contextTypes[subscriptionKey] = _react.PropTypes.instanceOf(_Subscription2.default), _contextTypes); | ||
var contextTypes = (_contextTypes = {}, _contextTypes[storeKey] = _storeShape2.default, _contextTypes[subscriptionKey] = _react.PropTypes.instanceOf(_Subscription2.default), _contextTypes.react15CompatibilityMode = _react.PropTypes.bool, _contextTypes); | ||
var childContextTypes = (_childContextTypes = {}, _childContextTypes[subscriptionKey] = _react.PropTypes.instanceOf(_Subscription2.default), _childContextTypes); | ||
@@ -99,2 +100,3 @@ | ||
displayName: displayName, | ||
wrappedComponentName: wrappedComponentName, | ||
WrappedComponent: WrappedComponent | ||
@@ -115,3 +117,12 @@ }); | ||
_this.store = _this.props[storeKey] || _this.context[storeKey]; | ||
_this.parentSub = _this.props[subscriptionKey] || _this.context[subscriptionKey]; | ||
// react15CompatibilityMode controls whether the subscription system is used. This is for | ||
// https://github.com/reactjs/react-redux/issues/525 and should be removed completely when | ||
// react-redux's dependency on react is bumped to mimimum v16, which is expected to include | ||
// PR https://github.com/facebook/react/pull/8204 which fixes the issue. | ||
var compatMode = [react15CompatibilityMode, props.react15CompatibilityMode, context.react15CompatibilityMode, defaultReact15CompatibilityMode].find(function (cm) { | ||
return cm !== undefined && cm !== null; | ||
}); | ||
_this.parentSub = compatMode ? null : props[subscriptionKey] || context[subscriptionKey]; | ||
_this.setWrappedInstance = _this.setWrappedInstance.bind(_this); | ||
@@ -277,2 +288,6 @@ | ||
}; | ||
} | ||
} | ||
connectAdvanced.setDefaultReact15CompatibilityMode = function setDefaultReact15CompatibilityMode(compat) { | ||
defaultReact15CompatibilityMode = compat; | ||
}; |
@@ -54,3 +54,3 @@ 'use strict'; | ||
function match(arg, factories) { | ||
function match(arg, factories, name) { | ||
for (var i = factories.length - 1; i >= 0; i--) { | ||
@@ -60,3 +60,6 @@ var result = factories[i](arg); | ||
} | ||
return undefined; | ||
return function (dispatch, options) { | ||
throw new Error('Invalid value of type ' + typeof arg + ' for ' + name + ' argument when connecting component ' + options.wrappedComponentName + '.'); | ||
}; | ||
} | ||
@@ -71,35 +74,32 @@ | ||
function createConnect() { | ||
var _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; | ||
var _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}, | ||
_ref$connectHOC = _ref.connectHOC, | ||
connectHOC = _ref$connectHOC === undefined ? _connectAdvanced2.default : _ref$connectHOC, | ||
_ref$mapStateToPropsF = _ref.mapStateToPropsFactories, | ||
mapStateToPropsFactories = _ref$mapStateToPropsF === undefined ? _mapStateToProps2.default : _ref$mapStateToPropsF, | ||
_ref$mapDispatchToPro = _ref.mapDispatchToPropsFactories, | ||
mapDispatchToPropsFactories = _ref$mapDispatchToPro === undefined ? _mapDispatchToProps2.default : _ref$mapDispatchToPro, | ||
_ref$mergePropsFactor = _ref.mergePropsFactories, | ||
mergePropsFactories = _ref$mergePropsFactor === undefined ? _mergeProps2.default : _ref$mergePropsFactor, | ||
_ref$selectorFactory = _ref.selectorFactory, | ||
selectorFactory = _ref$selectorFactory === undefined ? _selectorFactory2.default : _ref$selectorFactory; | ||
var _ref$connectHOC = _ref.connectHOC; | ||
var connectHOC = _ref$connectHOC === undefined ? _connectAdvanced2.default : _ref$connectHOC; | ||
var _ref$mapStateToPropsF = _ref.mapStateToPropsFactories; | ||
var mapStateToPropsFactories = _ref$mapStateToPropsF === undefined ? _mapStateToProps2.default : _ref$mapStateToPropsF; | ||
var _ref$mapDispatchToPro = _ref.mapDispatchToPropsFactories; | ||
var mapDispatchToPropsFactories = _ref$mapDispatchToPro === undefined ? _mapDispatchToProps2.default : _ref$mapDispatchToPro; | ||
var _ref$mergePropsFactor = _ref.mergePropsFactories; | ||
var mergePropsFactories = _ref$mergePropsFactor === undefined ? _mergeProps2.default : _ref$mergePropsFactor; | ||
var _ref$selectorFactory = _ref.selectorFactory; | ||
var selectorFactory = _ref$selectorFactory === undefined ? _selectorFactory2.default : _ref$selectorFactory; | ||
return function connect(mapStateToProps, mapDispatchToProps, mergeProps) { | ||
var _ref2 = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {}; | ||
var _ref2 = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {}, | ||
_ref2$pure = _ref2.pure, | ||
pure = _ref2$pure === undefined ? true : _ref2$pure, | ||
_ref2$areStatesEqual = _ref2.areStatesEqual, | ||
areStatesEqual = _ref2$areStatesEqual === undefined ? strictEqual : _ref2$areStatesEqual, | ||
_ref2$areOwnPropsEqua = _ref2.areOwnPropsEqual, | ||
areOwnPropsEqual = _ref2$areOwnPropsEqua === undefined ? _shallowEqual2.default : _ref2$areOwnPropsEqua, | ||
_ref2$areStatePropsEq = _ref2.areStatePropsEqual, | ||
areStatePropsEqual = _ref2$areStatePropsEq === undefined ? _shallowEqual2.default : _ref2$areStatePropsEq, | ||
_ref2$areMergedPropsE = _ref2.areMergedPropsEqual, | ||
areMergedPropsEqual = _ref2$areMergedPropsE === undefined ? _shallowEqual2.default : _ref2$areMergedPropsE, | ||
extraOptions = _objectWithoutProperties(_ref2, ['pure', 'areStatesEqual', 'areOwnPropsEqual', 'areStatePropsEqual', 'areMergedPropsEqual']); | ||
var _ref2$pure = _ref2.pure; | ||
var pure = _ref2$pure === undefined ? true : _ref2$pure; | ||
var _ref2$areStatesEqual = _ref2.areStatesEqual; | ||
var areStatesEqual = _ref2$areStatesEqual === undefined ? strictEqual : _ref2$areStatesEqual; | ||
var _ref2$areOwnPropsEqua = _ref2.areOwnPropsEqual; | ||
var areOwnPropsEqual = _ref2$areOwnPropsEqua === undefined ? _shallowEqual2.default : _ref2$areOwnPropsEqua; | ||
var _ref2$areStatePropsEq = _ref2.areStatePropsEqual; | ||
var areStatePropsEqual = _ref2$areStatePropsEq === undefined ? _shallowEqual2.default : _ref2$areStatePropsEq; | ||
var _ref2$areMergedPropsE = _ref2.areMergedPropsEqual; | ||
var areMergedPropsEqual = _ref2$areMergedPropsE === undefined ? _shallowEqual2.default : _ref2$areMergedPropsE; | ||
var initMapStateToProps = match(mapStateToProps, mapStateToPropsFactories, 'mapStateToProps'); | ||
var initMapDispatchToProps = match(mapDispatchToProps, mapDispatchToPropsFactories, 'mapDispatchToProps'); | ||
var initMergeProps = match(mergeProps, mergePropsFactories, 'mergeProps'); | ||
var extraOptions = _objectWithoutProperties(_ref2, ['pure', 'areStatesEqual', 'areOwnPropsEqual', 'areStatePropsEqual', 'areMergedPropsEqual']); | ||
var initMapStateToProps = match(mapStateToProps, mapStateToPropsFactories); | ||
var initMapDispatchToProps = match(mapDispatchToProps, mapDispatchToPropsFactories); | ||
var initMergeProps = match(mergeProps, mergePropsFactories); | ||
return connectHOC(selectorFactory, _extends({ | ||
@@ -131,2 +131,4 @@ // used in error messages | ||
exports.default = createConnect(); | ||
var connect = createConnect(); | ||
connect.setDefaultReact15CompatibilityMode = _connectAdvanced2.default.setDefaultReact15CompatibilityMode; | ||
exports.default = connect; |
@@ -24,5 +24,5 @@ 'use strict'; | ||
return function initMergePropsProxy(dispatch, _ref) { | ||
var displayName = _ref.displayName; | ||
var pure = _ref.pure; | ||
var areMergedPropsEqual = _ref.areMergedPropsEqual; | ||
var displayName = _ref.displayName, | ||
pure = _ref.pure, | ||
areMergedPropsEqual = _ref.areMergedPropsEqual; | ||
@@ -29,0 +29,0 @@ var hasRunOnce = false; |
@@ -23,5 +23,5 @@ 'use strict'; | ||
function pureFinalPropsSelectorFactory(mapStateToProps, mapDispatchToProps, mergeProps, dispatch, _ref) { | ||
var areStatesEqual = _ref.areStatesEqual; | ||
var areOwnPropsEqual = _ref.areOwnPropsEqual; | ||
var areStatePropsEqual = _ref.areStatePropsEqual; | ||
var areStatesEqual = _ref.areStatesEqual, | ||
areOwnPropsEqual = _ref.areOwnPropsEqual, | ||
areStatePropsEqual = _ref.areStatePropsEqual; | ||
@@ -98,8 +98,7 @@ var hasRunAtLeastOnce = false; | ||
function finalPropsSelectorFactory(dispatch, _ref2) { | ||
var initMapStateToProps = _ref2.initMapStateToProps; | ||
var initMapDispatchToProps = _ref2.initMapDispatchToProps; | ||
var initMergeProps = _ref2.initMergeProps; | ||
var initMapStateToProps = _ref2.initMapStateToProps, | ||
initMapDispatchToProps = _ref2.initMapDispatchToProps, | ||
initMergeProps = _ref2.initMergeProps, | ||
options = _objectWithoutProperties(_ref2, ['initMapStateToProps', 'initMapDispatchToProps', 'initMergeProps']); | ||
var options = _objectWithoutProperties(_ref2, ['initMapStateToProps', 'initMapDispatchToProps', 'initMergeProps']); | ||
var mapStateToProps = initMapStateToProps(dispatch, options); | ||
@@ -106,0 +105,0 @@ var mapDispatchToProps = initMapDispatchToProps(dispatch, options); |
@@ -25,5 +25,5 @@ "use strict"; | ||
notify: function notify() { | ||
current = next; | ||
for (var i = 0; i < current.length; i++) { | ||
current[i](); | ||
var listeners = current = next; | ||
for (var i = 0; i < listeners.length; i++) { | ||
listeners[i](); | ||
} | ||
@@ -30,0 +30,0 @@ }, |
{ | ||
"name": "react-redux", | ||
"version": "5.0.0-beta.3", | ||
"version": "5.0.0-rc.1", | ||
"description": "Official React bindings for Redux", | ||
@@ -52,6 +52,6 @@ "main": "./lib/index.js", | ||
"babel-core": "^6.3.26", | ||
"babel-eslint": "^6.1.2", | ||
"babel-eslint": "^7.1.1", | ||
"babel-loader": "^6.2.0", | ||
"babel-plugin-check-es2015-constants": "^6.3.13", | ||
"babel-plugin-istanbul": "^2.0.0", | ||
"babel-plugin-istanbul": "^3.0.0", | ||
"babel-plugin-syntax-jsx": "^6.3.13", | ||
@@ -81,16 +81,16 @@ "babel-plugin-transform-decorators-legacy": "^1.2.0", | ||
"codecov": "^1.0.1", | ||
"cross-env": "^1.0.7", | ||
"cross-env": "^3.1.3", | ||
"es3ify": "^0.2.0", | ||
"eslint": "^3.3.1", | ||
"eslint-plugin-import": "^1.13.0", | ||
"eslint-plugin-import": "^2.2.0", | ||
"eslint-plugin-react": "^6.1.1", | ||
"expect": "^1.8.0", | ||
"glob": "^6.0.4", | ||
"glob": "^7.1.1", | ||
"istanbul": "^0.4.4", | ||
"jsdom": "~5.4.3", | ||
"mocha": "^2.2.5", | ||
"nyc": "^8.1.0", | ||
"react": "^0.14.0", | ||
"react-addons-test-utils": "^0.14.0", | ||
"react-dom": "^0.14.0", | ||
"jsdom": "^9.8.3", | ||
"mocha": "^3.2.0", | ||
"nyc": "^10.0.0", | ||
"react": "^15.0.0", | ||
"react-addons-test-utils": "^15.0.0", | ||
"react-dom": "^15.0.0", | ||
"redux": "^3.0.0", | ||
@@ -97,0 +97,0 @@ "rimraf": "^2.3.4", |
@@ -8,2 +8,4 @@ import hoistStatics from 'hoist-non-react-statics' | ||
let defaultReact15CompatibilityMode = true | ||
let hotReloadingVersion = 0 | ||
@@ -22,3 +24,3 @@ export default function connectAdvanced( | ||
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. | ||
the selectorFactory, along with displayName and WrappedComponent, as the second argument. | ||
@@ -40,2 +42,5 @@ Note that selectorFactory is responsible for all caching/memoization of inbound and outbound | ||
// temporary compatibility setting for React 15. See Connect constructor for details | ||
react15CompatibilityMode = undefined, | ||
// if defined, the name of the property passed to the wrapped element indicating the number of | ||
@@ -63,7 +68,8 @@ // calls to render. useful for watching in react devtools for unnecessary re-renders. | ||
[storeKey]: storeShape, | ||
[subscriptionKey]: PropTypes.instanceOf(Subscription) | ||
[subscriptionKey]: PropTypes.instanceOf(Subscription), | ||
react15CompatibilityMode: PropTypes.bool, | ||
} | ||
const childContextTypes = { | ||
[subscriptionKey]: PropTypes.instanceOf(Subscription) | ||
} | ||
} | ||
@@ -92,2 +98,3 @@ return function wrapWithConnect(WrappedComponent) { | ||
displayName, | ||
wrappedComponentName, | ||
WrappedComponent | ||
@@ -104,3 +111,15 @@ } | ||
this.store = this.props[storeKey] || this.context[storeKey] | ||
this.parentSub = this.props[subscriptionKey] || this.context[subscriptionKey] | ||
// react15CompatibilityMode controls whether the subscription system is used. This is for | ||
// https://github.com/reactjs/react-redux/issues/525 and should be removed completely when | ||
// react-redux's dependency on react is bumped to mimimum v16, which is expected to include | ||
// PR https://github.com/facebook/react/pull/8204 which fixes the issue. | ||
const compatMode = [ | ||
react15CompatibilityMode, | ||
props.react15CompatibilityMode, | ||
context.react15CompatibilityMode, | ||
defaultReact15CompatibilityMode | ||
].find(cm => cm !== undefined && cm !== null) | ||
this.parentSub = compatMode ? null : props[subscriptionKey] || context[subscriptionKey] | ||
this.setWrappedInstance = this.setWrappedInstance.bind(this) | ||
@@ -265,1 +284,7 @@ | ||
} | ||
connectAdvanced.setDefaultReact15CompatibilityMode = | ||
function setDefaultReact15CompatibilityMode(compat) { | ||
defaultReact15CompatibilityMode = compat | ||
} | ||
@@ -25,3 +25,3 @@ import connectAdvanced from '../components/connectAdvanced' | ||
function match(arg, factories) { | ||
function match(arg, factories, name) { | ||
for (let i = factories.length - 1; i >= 0; i--) { | ||
@@ -31,3 +31,6 @@ const result = factories[i](arg) | ||
} | ||
return undefined | ||
return (dispatch, options) => { | ||
throw new Error(`Invalid value of type ${typeof arg} for ${name} argument when connecting component ${options.wrappedComponentName}.`) | ||
} | ||
} | ||
@@ -59,5 +62,5 @@ | ||
) { | ||
const initMapStateToProps = match(mapStateToProps, mapStateToPropsFactories) | ||
const initMapDispatchToProps = match(mapDispatchToProps, mapDispatchToPropsFactories) | ||
const initMergeProps = match(mergeProps, mergePropsFactories) | ||
const initMapStateToProps = match(mapStateToProps, mapStateToPropsFactories, 'mapStateToProps') | ||
const initMapDispatchToProps = match(mapDispatchToProps, mapDispatchToPropsFactories, 'mapDispatchToProps') | ||
const initMergeProps = match(mergeProps, mergePropsFactories, 'mergeProps') | ||
@@ -90,2 +93,4 @@ return connectHOC(selectorFactory, { | ||
export default createConnect() | ||
const connect = createConnect() | ||
connect.setDefaultReact15CompatibilityMode = connectAdvanced.setDefaultReact15CompatibilityMode | ||
export default connect |
@@ -20,5 +20,5 @@ // encapsulates the subscription logic for connecting a component to the redux store, as | ||
notify() { | ||
current = next | ||
for (let i = 0; i < current.length; i++) { | ||
current[i]() | ||
const listeners = current = next | ||
for (let i = 0; i < listeners.length; i++) { | ||
listeners[i]() | ||
} | ||
@@ -25,0 +25,0 @@ }, |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Uses eval
Supply chain riskPackage uses dynamic code execution (e.g., eval()), which is a dangerous practice. This can prevent the code from running in certain environments and increases the risk that the code may contain exploits or malicious behavior.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
184208
3360
4