Socket
Socket
Sign inDemoInstall

react-redux

Package Overview
Dependencies
Maintainers
1
Versions
140
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-redux - npm Package Compare versions

Comparing version 4.0.5 to 4.0.6

153

dist/react-redux.js

@@ -59,18 +59,7 @@ (function webpackUniversalModuleDefinition(root, factory) {

exports.__esModule = true;
exports.connect = exports.Provider = undefined;
var Provider = __webpack_require__(3);
var connect = __webpack_require__(4);
var _Provider = __webpack_require__(3);
module.exports = { Provider: Provider, connect: connect };
var _Provider2 = _interopRequireDefault(_Provider);
var _connect = __webpack_require__(4);
var _connect2 = _interopRequireDefault(_connect);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
exports.Provider = _Provider2.default;
exports.connect = _connect2.default;
/***/ },

@@ -88,12 +77,14 @@ /* 1 */

exports.__esModule = true;
var _require = __webpack_require__(1);
var _react = __webpack_require__(1);
var PropTypes = _require.PropTypes;
exports.default = _react.PropTypes.shape({
subscribe: _react.PropTypes.func.isRequired,
dispatch: _react.PropTypes.func.isRequired,
getState: _react.PropTypes.func.isRequired
var storeShape = PropTypes.shape({
subscribe: PropTypes.func.isRequired,
dispatch: PropTypes.func.isRequired,
getState: PropTypes.func.isRequired
});
module.exports = storeShape;
/***/ },

@@ -105,19 +96,16 @@ /* 3 */

exports.__esModule = true;
exports.default = undefined;
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
var _react = __webpack_require__(1);
function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
var _storeShape = __webpack_require__(2);
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
var _storeShape2 = _interopRequireDefault(_storeShape);
var _require = __webpack_require__(1);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
var Component = _require.Component;
var PropTypes = _require.PropTypes;
var Children = _require.Children;
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
var storeShape = __webpack_require__(2);
function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
var didWarnAboutReceivingStore = false;

@@ -162,18 +150,18 @@ function warnAboutReceivingStore() {

return _react.Children.only(children);
return Children.only(children);
};
return Provider;
})(_react.Component);
})(Component);
exports.default = Provider;
Provider.propTypes = {
store: _storeShape2.default.isRequired,
children: _react.PropTypes.element.isRequired
store: storeShape.isRequired,
children: PropTypes.element.isRequired
};
Provider.childContextTypes = {
store: _storeShape2.default.isRequired
store: storeShape.isRequired
};
module.exports = Provider;
/***/ },

@@ -187,39 +175,20 @@ /* 4 */

exports.__esModule = true;
exports.default = connect;
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
var _react = __webpack_require__(1);
function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
var _storeShape = __webpack_require__(2);
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
var _storeShape2 = _interopRequireDefault(_storeShape);
var _require = __webpack_require__(1);
var _shallowEqual = __webpack_require__(6);
var Component = _require.Component;
var createElement = _require.createElement;
var _shallowEqual2 = _interopRequireDefault(_shallowEqual);
var storeShape = __webpack_require__(2);
var shallowEqual = __webpack_require__(6);
var isPlainObject = __webpack_require__(5);
var wrapActionCreators = __webpack_require__(7);
var hoistStatics = __webpack_require__(8);
var invariant = __webpack_require__(9);
var _isPlainObject = __webpack_require__(5);
var _isPlainObject2 = _interopRequireDefault(_isPlainObject);
var _wrapActionCreators = __webpack_require__(7);
var _wrapActionCreators2 = _interopRequireDefault(_wrapActionCreators);
var _hoistNonReactStatics = __webpack_require__(8);
var _hoistNonReactStatics2 = _interopRequireDefault(_hoistNonReactStatics);
var _invariant = __webpack_require__(9);
var _invariant2 = _interopRequireDefault(_invariant);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
var defaultMapStateToProps = function defaultMapStateToProps(state) {

@@ -247,3 +216,3 @@ return {};

var finalMapStateToProps = mapStateToProps || defaultMapStateToProps;
var finalMapDispatchToProps = (0, _isPlainObject2.default)(mapDispatchToProps) ? (0, _wrapActionCreators2.default)(mapDispatchToProps) : mapDispatchToProps || defaultMapDispatchToProps;
var finalMapDispatchToProps = isPlainObject(mapDispatchToProps) ? wrapActionCreators(mapDispatchToProps) : mapDispatchToProps || defaultMapDispatchToProps;
var finalMergeProps = mergeProps || defaultMergeProps;

@@ -265,3 +234,3 @@ var doStatePropsDependOnOwnProps = finalMapStateToProps.length !== 1;

(0, _invariant2.default)((0, _isPlainObject2.default)(stateProps), '`mapStateToProps` must return an object. Instead received %s.', stateProps);
invariant(isPlainObject(stateProps), '`mapStateToProps` must return an object. Instead received %s.', stateProps);
return stateProps;

@@ -275,3 +244,3 @@ }

(0, _invariant2.default)((0, _isPlainObject2.default)(dispatchProps), '`mapDispatchToProps` must return an object. Instead received %s.', dispatchProps);
invariant(isPlainObject(dispatchProps), '`mapDispatchToProps` must return an object. Instead received %s.', dispatchProps);
return dispatchProps;

@@ -282,3 +251,3 @@ }

var mergedProps = finalMergeProps(stateProps, dispatchProps, parentProps);
(0, _invariant2.default)((0, _isPlainObject2.default)(mergedProps), '`mergeProps` must return an object. Instead received %s.', mergedProps);
invariant(isPlainObject(mergedProps), '`mergeProps` must return an object. Instead received %s.', mergedProps);
return mergedProps;

@@ -303,3 +272,3 @@ }

(0, _invariant2.default)(_this.store, 'Could not find "store" in either the context or ' + ('props of "' + _this.constructor.displayName + '". ') + 'Either wrap the root component in a <Provider>, ' + ('or explicitly pass "store" as a prop to "' + _this.constructor.displayName + '".'));
invariant(_this.store, 'Could not find "store" in either the context or ' + ('props of "' + _this.constructor.displayName + '". ') + 'Either wrap the root component in a <Provider>, ' + ('or explicitly pass "store" as a prop to "' + _this.constructor.displayName + '".'));

@@ -314,3 +283,3 @@ var storeState = _this.store.getState();

var nextStateProps = computeStateProps(this.store, this.props);
if (this.stateProps && (0, _shallowEqual2.default)(nextStateProps, this.stateProps)) {
if (this.stateProps && shallowEqual(nextStateProps, this.stateProps)) {
return false;

@@ -325,3 +294,3 @@ }

var nextDispatchProps = computeDispatchProps(this.store, this.props);
if (this.dispatchProps && (0, _shallowEqual2.default)(nextDispatchProps, this.dispatchProps)) {
if (this.dispatchProps && shallowEqual(nextDispatchProps, this.dispatchProps)) {
return false;

@@ -361,3 +330,3 @@ }

Connect.prototype.componentWillReceiveProps = function componentWillReceiveProps(nextProps) {
if (!pure || !(0, _shallowEqual2.default)(nextProps, this.props)) {
if (!pure || !shallowEqual(nextProps, this.props)) {
this.haveOwnPropsChanged = true;

@@ -396,3 +365,3 @@ }

Connect.prototype.getWrappedInstance = function getWrappedInstance() {
(0, _invariant2.default)(withRef, 'To access the wrapped instance, you need to specify ' + '{ withRef: true } as the fourth argument of the connect() call.');
invariant(withRef, 'To access the wrapped instance, you need to specify ' + '{ withRef: true } as the fourth argument of the connect() call.');

@@ -438,7 +407,7 @@ return this.refs.wrappedInstance;

if (withRef) {
this.renderedElement = (0, _react.createElement)(WrappedComponent, _extends({}, this.mergedProps, {
this.renderedElement = createElement(WrappedComponent, _extends({}, this.mergedProps, {
ref: 'wrappedInstance'
}));
} else {
this.renderedElement = (0, _react.createElement)(WrappedComponent, this.mergedProps);
this.renderedElement = createElement(WrappedComponent, this.mergedProps);
}

@@ -450,3 +419,3 @@

return Connect;
})(_react.Component);
})(Component);

@@ -456,6 +425,6 @@ Connect.displayName = 'Connect(' + getDisplayName(WrappedComponent) + ')';

Connect.contextTypes = {
store: _storeShape2.default
store: storeShape
};
Connect.propTypes = {
store: _storeShape2.default
store: storeShape
};

@@ -476,6 +445,8 @@

return (0, _hoistNonReactStatics2.default)(Connect, WrappedComponent);
return hoistStatics(Connect, WrappedComponent);
};
}
module.exports = connect;
/***/ },

@@ -487,5 +458,2 @@ /* 5 */

exports.__esModule = true;
exports.default = isPlainObject;
function _typeof(obj) { return obj && typeof Symbol !== "undefined" && obj.constructor === Symbol ? "symbol" : typeof obj; }

@@ -517,2 +485,4 @@

module.exports = isPlainObject;
/***/ },

@@ -524,4 +494,2 @@ /* 6 */

exports.__esModule = true;
exports.default = shallowEqual;
function shallowEqual(objA, objB) {

@@ -550,2 +518,4 @@ if (objA === objB) {

module.exports = shallowEqual;
/***/ },

@@ -557,5 +527,2 @@ /* 7 */

exports.__esModule = true;
exports.default = wrapActionCreators;
var _redux = __webpack_require__(10);

@@ -569,2 +536,4 @@

module.exports = wrapActionCreators;
/***/ },

@@ -571,0 +540,0 @@ /* 8 */

@@ -1,1 +0,1 @@

!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("react"),require("redux")):"function"==typeof define&&define.amd?define(["react","redux"],t):"object"==typeof exports?exports.ReactRedux=t(require("react"),require("redux")):e.ReactRedux=t(e.React,e.Redux)}(this,function(e,t){return function(e){function t(n){if(r[n])return r[n].exports;var o=r[n]={exports:{},id:n,loaded:!1};return e[n].call(o.exports,o,o.exports,t),o.loaded=!0,o.exports}var r={};return t.m=e,t.c=r,t.p="",t(0)}([function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{"default":e}}t.__esModule=!0,t.connect=t.Provider=void 0;var o=r(3),s=n(o),i=r(4),u=n(i);t.Provider=s.default,t.connect=u.default},function(t,r){t.exports=e},function(e,t,r){"use strict";t.__esModule=!0;var n=r(1);t.default=n.PropTypes.shape({subscribe:n.PropTypes.func.isRequired,dispatch:n.PropTypes.func.isRequired,getState:n.PropTypes.func.isRequired})},function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{"default":e}}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function s(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function i(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}function u(){f||(f=!0,console.error("<Provider> does not support changing `store` on the fly. It is most likely that you see this error because you updated to Redux 2.x and React Redux 2.x which no longer hot reload reducers automatically. See https://github.com/rackt/react-redux/releases/tag/v2.0.0 for the migration instructions."))}t.__esModule=!0,t.default=void 0;var a=r(1),c=r(2),p=n(c),f=!1,d=function(e){function t(r,n){o(this,t);var i=s(this,e.call(this,r,n));return i.store=r.store,i}return i(t,e),t.prototype.getChildContext=function(){return{store:this.store}},t.prototype.componentWillReceiveProps=function(e){var t=this.store,r=e.store;t!==r&&u()},t.prototype.render=function(){var e=this.props.children;return a.Children.only(e)},t}(a.Component);t.default=d,d.propTypes={store:p.default.isRequired,children:a.PropTypes.element.isRequired},d.childContextTypes={store:p.default.isRequired}},function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{"default":e}}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function s(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function i(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}function u(e){return e.displayName||e.name||"Component"}function a(e,t,r){function n(e,t){var r=e.getState(),n=j?m(r,t):m(r);return(0,w.default)((0,b.default)(n),"`mapStateToProps` must return an object. Instead received %s.",n),n}function a(e,t){var r=e.dispatch,n=R?g(r,t):g(r);return(0,w.default)((0,b.default)(n),"`mapDispatchToProps` must return an object. Instead received %s.",n),n}function f(e,t,r){var n=x(e,t,r);return(0,w.default)((0,b.default)(n),"`mergeProps` must return an object. Instead received %s.",n),n}var l=arguments.length<=3||void 0===arguments[3]?{}:arguments[3],y=Boolean(e),m=e||C,g=(0,b.default)(t)?(0,v.default)(t):t||S,x=r||O,j=1!==m.length,R=1!==g.length,T=l.pure,E=void 0===T?!0:T,M=l.withRef,I=void 0===M?!1:M,q=_++;return function(e){var t=function(t){function r(e,n){o(this,r);var i=s(this,t.call(this,e,n));i.version=q,i.store=e.store||n.store,(0,w.default)(i.store,'Could not find "store" in either the context or '+('props of "'+i.constructor.displayName+'". ')+"Either wrap the root component in a <Provider>, "+('or explicitly pass "store" as a prop to "'+i.constructor.displayName+'".'));var u=i.store.getState();return i.state={storeState:u},i.clearCache(),i}return i(r,t),r.prototype.shouldComponentUpdate=function(){return!E||this.haveOwnPropsChanged||this.hasStoreStateChanged},r.prototype.updateStatePropsIfNeeded=function(){var e=n(this.store,this.props);return this.stateProps&&(0,h.default)(e,this.stateProps)?!1:(this.stateProps=e,!0)},r.prototype.updateDispatchPropsIfNeeded=function(){var e=a(this.store,this.props);return this.dispatchProps&&(0,h.default)(e,this.dispatchProps)?!1:(this.dispatchProps=e,!0)},r.prototype.updateMergedProps=function(){this.mergedProps=f(this.stateProps,this.dispatchProps,this.props)},r.prototype.isSubscribed=function(){return"function"==typeof this.unsubscribe},r.prototype.trySubscribe=function(){y&&!this.unsubscribe&&(this.unsubscribe=this.store.subscribe(this.handleChange.bind(this)),this.handleChange())},r.prototype.tryUnsubscribe=function(){this.unsubscribe&&(this.unsubscribe(),this.unsubscribe=null)},r.prototype.componentDidMount=function(){this.trySubscribe()},r.prototype.componentWillReceiveProps=function(e){E&&(0,h.default)(e,this.props)||(this.haveOwnPropsChanged=!0)},r.prototype.componentWillUnmount=function(){this.tryUnsubscribe(),this.clearCache()},r.prototype.clearCache=function(){this.dispatchProps=null,this.stateProps=null,this.mergedProps=null,this.haveOwnPropsChanged=!0,this.hasStoreStateChanged=!0,this.renderedElement=null},r.prototype.handleChange=function(){if(this.unsubscribe){var e=this.state.storeState,t=this.store.getState();E&&e===t||(this.hasStoreStateChanged=!0,this.setState({storeState:t}))}},r.prototype.getWrappedInstance=function(){return(0,w.default)(I,"To access the wrapped instance, you need to specify { withRef: true } as the fourth argument of the connect() call."),this.refs.wrappedInstance},r.prototype.render=function(){var t=this.haveOwnPropsChanged,r=this.hasStoreStateChanged,n=this.renderedElement;this.haveOwnPropsChanged=!1,this.hasStoreStateChanged=!1;var o=!0,s=!0;E&&n&&(o=r||t&&j,s=t&&R);var i=!1,u=!1;o&&(i=this.updateStatePropsIfNeeded()),s&&(u=this.updateDispatchPropsIfNeeded());var a=!0;return i||u||t?this.updateMergedProps():a=!1,!a&&n?n:(I?this.renderedElement=(0,p.createElement)(e,c({},this.mergedProps,{ref:"wrappedInstance"})):this.renderedElement=(0,p.createElement)(e,this.mergedProps),this.renderedElement)},r}(p.Component);return t.displayName="Connect("+u(e)+")",t.WrappedComponent=e,t.contextTypes={store:d.default},t.propTypes={store:d.default},(0,P.default)(t,e)}}var c=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e};t.__esModule=!0,t.default=a;var p=r(1),f=r(2),d=n(f),l=r(6),h=n(l),y=r(5),b=n(y),m=r(7),v=n(m),g=r(8),P=n(g),x=r(9),w=n(x),C=function(e){return{}},S=function(e){return{dispatch:e}},O=function(e,t,r){return c({},r,e,t)},_=0},function(e,t){"use strict";function r(e){return e&&"undefined"!=typeof Symbol&&e.constructor===Symbol?"symbol":typeof e}function n(e){if(!e||"object"!==("undefined"==typeof e?"undefined":r(e)))return!1;var t="function"==typeof e.constructor?Object.getPrototypeOf(e):Object.prototype;if(null===t)return!0;var n=t.constructor;return"function"==typeof n&&n instanceof n&&o(n)===o(Object)}t.__esModule=!0,t.default=n;var o=function(e){return Function.prototype.toString.call(e)}},function(e,t){"use strict";function r(e,t){if(e===t)return!0;var r=Object.keys(e),n=Object.keys(t);if(r.length!==n.length)return!1;for(var o=Object.prototype.hasOwnProperty,s=0;s<r.length;s++)if(!o.call(t,r[s])||e[r[s]]!==t[r[s]])return!1;return!0}t.__esModule=!0,t.default=r},function(e,t,r){"use strict";function n(e){return function(t){return(0,o.bindActionCreators)(e,t)}}t.__esModule=!0,t.default=n;var o=r(10)},function(e,t){"use strict";var r={childContextTypes:!0,contextTypes:!0,defaultProps:!0,displayName:!0,getDefaultProps:!0,mixins:!0,propTypes:!0,type:!0},n={name:!0,length:!0,prototype:!0,caller:!0,arguments:!0,arity:!0};e.exports=function(e,t){for(var o=Object.getOwnPropertyNames(t),s=0;s<o.length;++s)r[o[s]]||n[o[s]]||(e[o[s]]=t[o[s]]);return e}},function(e,t,r){"use strict";var n=function(e,t,r,n,o,s,i,u){if(!e){var a;if(void 0===t)a=new Error("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{var c=[r,n,o,s,i,u],p=0;a=new Error(t.replace(/%s/g,function(){return c[p++]})),a.name="Invariant Violation"}throw a.framesToPop=1,a}};e.exports=n},function(e,r){e.exports=t}])});
!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(n){if(r[n])return r[n].exports;var o=r[n]={exports:{},id:n,loaded:!1};return t[n].call(o.exports,o,o.exports,e),o.loaded=!0,o.exports}var r={};return e.m=t,e.c=r,e.p="",e(0)}([function(t,e,r){"use strict";var n=r(3),o=r(4);t.exports={Provider:n,connect:o}},function(e,r){e.exports=t},function(t,e,r){"use strict";var n=r(1),o=n.PropTypes,s=o.shape({subscribe:o.func.isRequired,dispatch:o.func.isRequired,getState:o.func.isRequired});t.exports=s},function(t,e,r){"use strict";function n(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function o(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 i(){f||(f=!0,console.error("<Provider> does not support changing `store` on the fly. It is most likely that you see this error because you updated to Redux 2.x and React Redux 2.x which no longer hot reload reducers automatically. See https://github.com/rackt/react-redux/releases/tag/v2.0.0 for the migration instructions."))}var u=r(1),a=u.Component,p=u.PropTypes,c=u.Children,h=r(2),f=!1,d=function(t){function e(r,s){n(this,e);var i=o(this,t.call(this,r,s));return i.store=r.store,i}return s(e,t),e.prototype.getChildContext=function(){return{store:this.store}},e.prototype.componentWillReceiveProps=function(t){var e=this.store,r=t.store;e!==r&&i()},e.prototype.render=function(){var t=this.props.children;return c.only(t)},e}(a);d.propTypes={store:h.isRequired,children:p.element.isRequired},d.childContextTypes={store:h.isRequired},t.exports=d},function(t,e,r){"use strict";function n(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function o(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 i(t){return t.displayName||t.name||"Component"}function u(t,e,r){function u(t,e){var r=t.getState(),n=T?O(r,e):O(r);return m(l(n),"`mapStateToProps` must return an object. Instead received %s.",n),n}function p(t,e){var r=t.dispatch,n=E?j(r,e):j(r);return m(l(n),"`mapDispatchToProps` must return an object. Instead received %s.",n),n}function w(t,e,r){var n=R(t,e,r);return m(l(n),"`mergeProps` must return an object. Instead received %s.",n),n}var C=arguments.length<=3||void 0===arguments[3]?{}:arguments[3],S=Boolean(t),O=t||v,j=l(e)?y(e):e||g,R=r||P,T=1!==O.length,E=1!==j.length,I=C.pure,q=void 0===I?!0:I,N=C.withRef,_=void 0===N?!1:N,D=x++;return function(t){var e=function(e){function r(t,s){n(this,r);var i=o(this,e.call(this,t,s));i.version=D,i.store=t.store||s.store,m(i.store,'Could not find "store" in either the context or '+('props of "'+i.constructor.displayName+'". ')+"Either wrap the root component in a <Provider>, "+('or explicitly pass "store" as a prop to "'+i.constructor.displayName+'".'));var u=i.store.getState();return i.state={storeState:u},i.clearCache(),i}return s(r,e),r.prototype.shouldComponentUpdate=function(){return!q||this.haveOwnPropsChanged||this.hasStoreStateChanged},r.prototype.updateStatePropsIfNeeded=function(){var t=u(this.store,this.props);return this.stateProps&&d(t,this.stateProps)?!1:(this.stateProps=t,!0)},r.prototype.updateDispatchPropsIfNeeded=function(){var t=p(this.store,this.props);return this.dispatchProps&&d(t,this.dispatchProps)?!1:(this.dispatchProps=t,!0)},r.prototype.updateMergedProps=function(){this.mergedProps=w(this.stateProps,this.dispatchProps,this.props)},r.prototype.isSubscribed=function(){return"function"==typeof this.unsubscribe},r.prototype.trySubscribe=function(){S&&!this.unsubscribe&&(this.unsubscribe=this.store.subscribe(this.handleChange.bind(this)),this.handleChange())},r.prototype.tryUnsubscribe=function(){this.unsubscribe&&(this.unsubscribe(),this.unsubscribe=null)},r.prototype.componentDidMount=function(){this.trySubscribe()},r.prototype.componentWillReceiveProps=function(t){q&&d(t,this.props)||(this.haveOwnPropsChanged=!0)},r.prototype.componentWillUnmount=function(){this.tryUnsubscribe(),this.clearCache()},r.prototype.clearCache=function(){this.dispatchProps=null,this.stateProps=null,this.mergedProps=null,this.haveOwnPropsChanged=!0,this.hasStoreStateChanged=!0,this.renderedElement=null},r.prototype.handleChange=function(){if(this.unsubscribe){var t=this.state.storeState,e=this.store.getState();q&&t===e||(this.hasStoreStateChanged=!0,this.setState({storeState:e}))}},r.prototype.getWrappedInstance=function(){return m(_,"To access the wrapped instance, you need to specify { withRef: true } as the fourth argument of the connect() call."),this.refs.wrappedInstance},r.prototype.render=function(){var e=this.haveOwnPropsChanged,r=this.hasStoreStateChanged,n=this.renderedElement;this.haveOwnPropsChanged=!1,this.hasStoreStateChanged=!1;var o=!0,s=!0;q&&n&&(o=r||e&&T,s=e&&E);var i=!1,u=!1;o&&(i=this.updateStatePropsIfNeeded()),s&&(u=this.updateDispatchPropsIfNeeded());var p=!0;return i||u||e?this.updateMergedProps():p=!1,!p&&n?n:(_?this.renderedElement=h(t,a({},this.mergedProps,{ref:"wrappedInstance"})):this.renderedElement=h(t,this.mergedProps),this.renderedElement)},r}(c);return e.displayName="Connect("+i(t)+")",e.WrappedComponent=t,e.contextTypes={store:f},e.propTypes={store:f},b(e,t)}}var a=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(t[n]=r[n])}return t},p=r(1),c=p.Component,h=p.createElement,f=r(2),d=r(6),l=r(5),y=r(7),b=r(8),m=r(9),v=function(t){return{}},g=function(t){return{dispatch:t}},P=function(t,e,r){return a({},r,t,e)},x=0;t.exports=u},function(t,e){"use strict";function r(t){return t&&"undefined"!=typeof Symbol&&t.constructor===Symbol?"symbol":typeof t}function n(t){if(!t||"object"!==("undefined"==typeof t?"undefined":r(t)))return!1;var e="function"==typeof t.constructor?Object.getPrototypeOf(t):Object.prototype;if(null===e)return!0;var n=e.constructor;return"function"==typeof n&&n instanceof n&&o(n)===o(Object)}var o=function(t){return Function.prototype.toString.call(t)};t.exports=n},function(t,e){"use strict";function r(t,e){if(t===e)return!0;var r=Object.keys(t),n=Object.keys(e);if(r.length!==n.length)return!1;for(var o=Object.prototype.hasOwnProperty,s=0;s<r.length;s++)if(!o.call(e,r[s])||t[r[s]]!==e[r[s]])return!1;return!0}t.exports=r},function(t,e,r){"use strict";function n(t){return function(e){return(0,o.bindActionCreators)(t,e)}}var o=r(10);t.exports=n},function(t,e){"use strict";var r={childContextTypes:!0,contextTypes:!0,defaultProps:!0,displayName:!0,getDefaultProps:!0,mixins:!0,propTypes:!0,type:!0},n={name:!0,length:!0,prototype:!0,caller:!0,arguments:!0,arity:!0};t.exports=function(t,e){for(var o=Object.getOwnPropertyNames(e),s=0;s<o.length;++s)r[o[s]]||n[o[s]]||(t[o[s]]=e[o[s]]);return t}},function(t,e,r){"use strict";var n=function(t,e,r,n,o,s,i,u){if(!t){var a;if(void 0===e)a=new Error("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{var p=[r,n,o,s,i,u],c=0;a=new Error(e.replace(/%s/g,function(){return p[c++]})),a.name="Invariant Violation"}throw a.framesToPop=1,a}};t.exports=n},function(t,r){t.exports=e}])});

@@ -5,39 +5,20 @@ 'use strict';

exports.__esModule = true;
exports.default = connect;
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
var _react = require('react');
function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
var _storeShape = require('../utils/storeShape');
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
var _storeShape2 = _interopRequireDefault(_storeShape);
var _require = require('react');
var _shallowEqual = require('../utils/shallowEqual');
var Component = _require.Component;
var createElement = _require.createElement;
var _shallowEqual2 = _interopRequireDefault(_shallowEqual);
var storeShape = require('../utils/storeShape');
var shallowEqual = require('../utils/shallowEqual');
var isPlainObject = require('../utils/isPlainObject');
var wrapActionCreators = require('../utils/wrapActionCreators');
var hoistStatics = require('hoist-non-react-statics');
var invariant = require('invariant');
var _isPlainObject = require('../utils/isPlainObject');
var _isPlainObject2 = _interopRequireDefault(_isPlainObject);
var _wrapActionCreators = require('../utils/wrapActionCreators');
var _wrapActionCreators2 = _interopRequireDefault(_wrapActionCreators);
var _hoistNonReactStatics = require('hoist-non-react-statics');
var _hoistNonReactStatics2 = _interopRequireDefault(_hoistNonReactStatics);
var _invariant = require('invariant');
var _invariant2 = _interopRequireDefault(_invariant);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
var defaultMapStateToProps = function defaultMapStateToProps(state) {

@@ -65,3 +46,3 @@ return {};

var finalMapStateToProps = mapStateToProps || defaultMapStateToProps;
var finalMapDispatchToProps = (0, _isPlainObject2.default)(mapDispatchToProps) ? (0, _wrapActionCreators2.default)(mapDispatchToProps) : mapDispatchToProps || defaultMapDispatchToProps;
var finalMapDispatchToProps = isPlainObject(mapDispatchToProps) ? wrapActionCreators(mapDispatchToProps) : mapDispatchToProps || defaultMapDispatchToProps;
var finalMergeProps = mergeProps || defaultMergeProps;

@@ -83,3 +64,3 @@ var doStatePropsDependOnOwnProps = finalMapStateToProps.length !== 1;

(0, _invariant2.default)((0, _isPlainObject2.default)(stateProps), '`mapStateToProps` must return an object. Instead received %s.', stateProps);
invariant(isPlainObject(stateProps), '`mapStateToProps` must return an object. Instead received %s.', stateProps);
return stateProps;

@@ -93,3 +74,3 @@ }

(0, _invariant2.default)((0, _isPlainObject2.default)(dispatchProps), '`mapDispatchToProps` must return an object. Instead received %s.', dispatchProps);
invariant(isPlainObject(dispatchProps), '`mapDispatchToProps` must return an object. Instead received %s.', dispatchProps);
return dispatchProps;

@@ -100,3 +81,3 @@ }

var mergedProps = finalMergeProps(stateProps, dispatchProps, parentProps);
(0, _invariant2.default)((0, _isPlainObject2.default)(mergedProps), '`mergeProps` must return an object. Instead received %s.', mergedProps);
invariant(isPlainObject(mergedProps), '`mergeProps` must return an object. Instead received %s.', mergedProps);
return mergedProps;

@@ -121,3 +102,3 @@ }

(0, _invariant2.default)(_this.store, 'Could not find "store" in either the context or ' + ('props of "' + _this.constructor.displayName + '". ') + 'Either wrap the root component in a <Provider>, ' + ('or explicitly pass "store" as a prop to "' + _this.constructor.displayName + '".'));
invariant(_this.store, 'Could not find "store" in either the context or ' + ('props of "' + _this.constructor.displayName + '". ') + 'Either wrap the root component in a <Provider>, ' + ('or explicitly pass "store" as a prop to "' + _this.constructor.displayName + '".'));

@@ -132,3 +113,3 @@ var storeState = _this.store.getState();

var nextStateProps = computeStateProps(this.store, this.props);
if (this.stateProps && (0, _shallowEqual2.default)(nextStateProps, this.stateProps)) {
if (this.stateProps && shallowEqual(nextStateProps, this.stateProps)) {
return false;

@@ -143,3 +124,3 @@ }

var nextDispatchProps = computeDispatchProps(this.store, this.props);
if (this.dispatchProps && (0, _shallowEqual2.default)(nextDispatchProps, this.dispatchProps)) {
if (this.dispatchProps && shallowEqual(nextDispatchProps, this.dispatchProps)) {
return false;

@@ -179,3 +160,3 @@ }

Connect.prototype.componentWillReceiveProps = function componentWillReceiveProps(nextProps) {
if (!pure || !(0, _shallowEqual2.default)(nextProps, this.props)) {
if (!pure || !shallowEqual(nextProps, this.props)) {
this.haveOwnPropsChanged = true;

@@ -214,3 +195,3 @@ }

Connect.prototype.getWrappedInstance = function getWrappedInstance() {
(0, _invariant2.default)(withRef, 'To access the wrapped instance, you need to specify ' + '{ withRef: true } as the fourth argument of the connect() call.');
invariant(withRef, 'To access the wrapped instance, you need to specify ' + '{ withRef: true } as the fourth argument of the connect() call.');

@@ -256,7 +237,7 @@ return this.refs.wrappedInstance;

if (withRef) {
this.renderedElement = (0, _react.createElement)(WrappedComponent, _extends({}, this.mergedProps, {
this.renderedElement = createElement(WrappedComponent, _extends({}, this.mergedProps, {
ref: 'wrappedInstance'
}));
} else {
this.renderedElement = (0, _react.createElement)(WrappedComponent, this.mergedProps);
this.renderedElement = createElement(WrappedComponent, this.mergedProps);
}

@@ -268,3 +249,3 @@

return Connect;
})(_react.Component);
})(Component);

@@ -274,6 +255,6 @@ Connect.displayName = 'Connect(' + getDisplayName(WrappedComponent) + ')';

Connect.contextTypes = {
store: _storeShape2.default
store: storeShape
};
Connect.propTypes = {
store: _storeShape2.default
store: storeShape
};

@@ -294,4 +275,6 @@

return (0, _hoistNonReactStatics2.default)(Connect, WrappedComponent);
return hoistStatics(Connect, WrappedComponent);
};
}
}
module.exports = connect;
'use strict';
exports.__esModule = true;
exports.default = undefined;
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
var _react = require('react');
function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
var _storeShape = require('../utils/storeShape');
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
var _storeShape2 = _interopRequireDefault(_storeShape);
var _require = require('react');
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
var Component = _require.Component;
var PropTypes = _require.PropTypes;
var Children = _require.Children;
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
var storeShape = require('../utils/storeShape');
function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
var didWarnAboutReceivingStore = false;

@@ -59,16 +56,16 @@ function warnAboutReceivingStore() {

return _react.Children.only(children);
return Children.only(children);
};
return Provider;
})(_react.Component);
})(Component);
exports.default = Provider;
Provider.propTypes = {
store: _storeShape2.default.isRequired,
children: _react.PropTypes.element.isRequired
store: storeShape.isRequired,
children: PropTypes.element.isRequired
};
Provider.childContextTypes = {
store: _storeShape2.default.isRequired
};
store: storeShape.isRequired
};
module.exports = Provider;
'use strict';
exports.__esModule = true;
exports.connect = exports.Provider = undefined;
var Provider = require('./components/Provider');
var connect = require('./components/connect');
var _Provider = require('./components/Provider');
var _Provider2 = _interopRequireDefault(_Provider);
var _connect = require('./components/connect');
var _connect2 = _interopRequireDefault(_connect);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
exports.Provider = _Provider2.default;
exports.connect = _connect2.default;
module.exports = { Provider: Provider, connect: connect };
'use strict';
exports.__esModule = true;
exports.default = isPlainObject;
function _typeof(obj) { return obj && typeof Symbol !== "undefined" && obj.constructor === Symbol ? "symbol" : typeof obj; }

@@ -30,2 +27,4 @@

return typeof constructor === 'function' && constructor instanceof constructor && fnToString(constructor) === fnToString(Object);
}
}
module.exports = isPlainObject;
"use strict";
exports.__esModule = true;
exports.default = shallowEqual;
function shallowEqual(objA, objB) {

@@ -26,2 +24,4 @@ if (objA === objB) {

return true;
}
}
module.exports = shallowEqual;
'use strict';
exports.__esModule = true;
var _require = require('react');
var _react = require('react');
var PropTypes = _require.PropTypes;
exports.default = _react.PropTypes.shape({
subscribe: _react.PropTypes.func.isRequired,
dispatch: _react.PropTypes.func.isRequired,
getState: _react.PropTypes.func.isRequired
});
var storeShape = PropTypes.shape({
subscribe: PropTypes.func.isRequired,
dispatch: PropTypes.func.isRequired,
getState: PropTypes.func.isRequired
});
module.exports = storeShape;
'use strict';
exports.__esModule = true;
exports.default = wrapActionCreators;
var _redux = require('redux');

@@ -12,2 +9,4 @@

};
}
}
module.exports = wrapActionCreators;
{
"name": "react-redux",
"version": "4.0.5",
"version": "4.0.6",
"description": "Official React bindings for Redux",

@@ -46,8 +46,8 @@ "main": "./lib/index.js",

"devDependencies": {
"babel-cli": "^6.3.15",
"babel-core": "^6.1.20",
"babel-cli": "^6.3.17",
"babel-core": "^6.3.26",
"babel-eslint": "^5.0.0-beta4",
"babel-loader": "^6.2.0",
"babel-plugin-transform-decorators-legacy": "^1.2.0",
"babel-preset-es2015-loose": "^6.1.3",
"babel-preset-es2015-loose": "^6.1.4",
"babel-preset-react": "^6.3.13",

@@ -54,0 +54,0 @@ "babel-preset-stage-0": "^6.3.13",

@@ -1,8 +0,8 @@

import { Component, createElement } from 'react'
import storeShape from '../utils/storeShape'
import shallowEqual from '../utils/shallowEqual'
import isPlainObject from '../utils/isPlainObject'
import wrapActionCreators from '../utils/wrapActionCreators'
import hoistStatics from 'hoist-non-react-statics'
import invariant from 'invariant'
const { Component, createElement } = require('react')
const storeShape = require('../utils/storeShape')
const shallowEqual = require('../utils/shallowEqual')
const isPlainObject = require('../utils/isPlainObject')
const wrapActionCreators = require('../utils/wrapActionCreators')
const hoistStatics = require('hoist-non-react-statics')
const invariant = require('invariant')

@@ -24,3 +24,3 @@ const defaultMapStateToProps = state => ({}) // eslint-disable-line no-unused-vars

export default function connect(mapStateToProps, mapDispatchToProps, mergeProps, options = {}) {
function connect(mapStateToProps, mapDispatchToProps, mergeProps, options = {}) {
const shouldSubscribe = Boolean(mapStateToProps)

@@ -277,1 +277,3 @@ const finalMapStateToProps = mapStateToProps || defaultMapStateToProps

}
module.exports = connect

@@ -1,3 +0,3 @@

import { Component, PropTypes, Children } from 'react'
import storeShape from '../utils/storeShape'
const { Component, PropTypes, Children } = require('react')
const storeShape = require('../utils/storeShape')

@@ -20,3 +20,3 @@ let didWarnAboutReceivingStore = false

export default class Provider extends Component {
class Provider extends Component {
getChildContext() {

@@ -53,1 +53,3 @@ return { store: this.store }

}
module.exports = Provider

@@ -1,4 +0,4 @@

import Provider from './components/Provider'
import connect from './components/connect'
const Provider = require('./components/Provider')
const connect = require('./components/connect')
export { Provider, connect }
module.exports = { Provider, connect }

@@ -7,3 +7,3 @@ const fnToString = (fn) => Function.prototype.toString.call(fn)

*/
export default function isPlainObject(obj) {
function isPlainObject(obj) {
if (!obj || typeof obj !== 'object') {

@@ -27,1 +27,3 @@ return false

}
module.exports = isPlainObject

@@ -1,2 +0,2 @@

export default function shallowEqual(objA, objB) {
function shallowEqual(objA, objB) {
if (objA === objB) {

@@ -24,1 +24,3 @@ return true

}
module.exports = shallowEqual

@@ -1,4 +0,4 @@

import { PropTypes } from 'react'
const { PropTypes } = require('react')
export default PropTypes.shape({
const storeShape = PropTypes.shape({
subscribe: PropTypes.func.isRequired,

@@ -8,1 +8,3 @@ dispatch: PropTypes.func.isRequired,

})
module.exports = storeShape
import { bindActionCreators } from 'redux'
export default function wrapActionCreators(actionCreators) {
function wrapActionCreators(actionCreators) {
return dispatch => bindActionCreators(actionCreators, dispatch)
}
module.exports = wrapActionCreators
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc