react-redux
Advanced tools
Comparing version 0.6.0 to 0.7.0
@@ -10,3 +10,3 @@ (function webpackUniversalModuleDefinition(root, factory) { | ||
root["ReactRedux"] = factory(root["React"], root["Redux"]); | ||
})(this, function(__WEBPACK_EXTERNAL_MODULE_9__, __WEBPACK_EXTERNAL_MODULE_10__) { | ||
})(this, function(__WEBPACK_EXTERNAL_MODULE_10__, __WEBPACK_EXTERNAL_MODULE_11__) { | ||
return /******/ (function(modules) { // webpackBootstrap | ||
@@ -64,3 +64,3 @@ /******/ // The module cache | ||
var _react = __webpack_require__(9); | ||
var _react = __webpack_require__(10); | ||
@@ -131,3 +131,3 @@ var _react2 = _interopRequireDefault(_react); | ||
'use strict'; | ||
/* WEBPACK VAR INJECTION */(function(process) {'use strict'; | ||
@@ -221,4 +221,4 @@ exports.__esModule = true; | ||
return function (DecoratedComponent) { | ||
return (function (_Component) { | ||
return function wrapWithConnect(WrappedComponent) { | ||
var Connect = (function (_Component) { | ||
_inherits(Connect, _Component); | ||
@@ -232,7 +232,7 @@ | ||
key: 'displayName', | ||
value: 'Connect(' + getDisplayName(DecoratedComponent) + ')', | ||
value: 'Connect(' + getDisplayName(WrappedComponent) + ')', | ||
enumerable: true | ||
}, { | ||
key: 'DecoratedComponent', | ||
value: DecoratedComponent, | ||
key: 'WrappedComponent', | ||
value: WrappedComponent, | ||
enumerable: true | ||
@@ -252,4 +252,2 @@ }, { | ||
this.version = version; | ||
this.setUnderlyingRef = this.setUnderlyingRef.bind(this); | ||
this.stateProps = computeStateProps(context); | ||
@@ -317,19 +315,2 @@ this.dispatchProps = computeDispatchProps(context); | ||
Connect.prototype.componentWillUpdate = function componentWillUpdate() { | ||
if (true) { | ||
if (this.version === version) { | ||
return; | ||
} | ||
// We are hot reloading! | ||
this.version = version; | ||
// Update the state and bindings. | ||
this.trySubscribe(); | ||
this.recomputeStateProps(); | ||
this.recomputeDispatchProps(); | ||
this.recomputeState(); | ||
} | ||
}; | ||
Connect.prototype.componentWillReceiveProps = function componentWillReceiveProps(nextProps) { | ||
@@ -351,12 +332,8 @@ if (!_utilsShallowEqual2['default'](nextProps, this.props)) { | ||
Connect.prototype.getUnderlyingRef = function getUnderlyingRef() { | ||
return this.underlyingRef; | ||
Connect.prototype.getWrappedInstance = function getWrappedInstance() { | ||
return this.refs.wrappedInstance; | ||
}; | ||
Connect.prototype.setUnderlyingRef = function setUnderlyingRef(instance) { | ||
this.underlyingRef = instance; | ||
}; | ||
Connect.prototype.render = function render() { | ||
return React.createElement(DecoratedComponent, _extends({ ref: this.setUnderlyingRef | ||
return React.createElement(WrappedComponent, _extends({ ref: 'wrappedInstance' | ||
}, this.state)); | ||
@@ -367,2 +344,26 @@ }; | ||
})(Component); | ||
if ( | ||
// Node-like CommonJS environments (Browserify, Webpack) | ||
typeof process !== 'undefined' && typeof process.env !== 'undefined' && ("development") !== 'production' || | ||
// React Native | ||
typeof __DEV__ !== 'undefined' && __DEV__ //eslint-disable-line no-undef | ||
) { | ||
Connect.prototype.componentWillUpdate = function componentWillUpdate() { | ||
if (this.version === version) { | ||
return; | ||
} | ||
// We are hot reloading! | ||
this.version = version; | ||
// Update the state and bindings. | ||
this.trySubscribe(); | ||
this.recomputeStateProps(); | ||
this.recomputeDispatchProps(); | ||
this.recomputeState(); | ||
}; | ||
} | ||
return Connect; | ||
}; | ||
@@ -373,2 +374,3 @@ }; | ||
module.exports = exports['default']; | ||
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(9))) | ||
@@ -531,3 +533,3 @@ /***/ }, | ||
var _redux = __webpack_require__(10); | ||
var _redux = __webpack_require__(11); | ||
@@ -605,4 +607,94 @@ function wrapActionCreators(actionCreators) { | ||
module.exports = __WEBPACK_EXTERNAL_MODULE_9__; | ||
// shim for using process in browser | ||
var process = module.exports = {}; | ||
var queue = []; | ||
var draining = false; | ||
var currentQueue; | ||
var queueIndex = -1; | ||
function cleanUpNextTick() { | ||
draining = false; | ||
if (currentQueue.length) { | ||
queue = currentQueue.concat(queue); | ||
} else { | ||
queueIndex = -1; | ||
} | ||
if (queue.length) { | ||
drainQueue(); | ||
} | ||
} | ||
function drainQueue() { | ||
if (draining) { | ||
return; | ||
} | ||
var timeout = setTimeout(cleanUpNextTick); | ||
draining = true; | ||
var len = queue.length; | ||
while(len) { | ||
currentQueue = queue; | ||
queue = []; | ||
while (++queueIndex < len) { | ||
currentQueue[queueIndex].run(); | ||
} | ||
queueIndex = -1; | ||
len = queue.length; | ||
} | ||
currentQueue = null; | ||
draining = false; | ||
clearTimeout(timeout); | ||
} | ||
process.nextTick = function (fun) { | ||
var args = new Array(arguments.length - 1); | ||
if (arguments.length > 1) { | ||
for (var i = 1; i < arguments.length; i++) { | ||
args[i - 1] = arguments[i]; | ||
} | ||
} | ||
queue.push(new Item(fun, args)); | ||
if (queue.length === 1 && !draining) { | ||
setTimeout(drainQueue, 0); | ||
} | ||
}; | ||
// v8 likes predictible objects | ||
function Item(fun, array) { | ||
this.fun = fun; | ||
this.array = array; | ||
} | ||
Item.prototype.run = function () { | ||
this.fun.apply(null, this.array); | ||
}; | ||
process.title = 'browser'; | ||
process.browser = true; | ||
process.env = {}; | ||
process.argv = []; | ||
process.version = ''; // empty string to avoid regexp issues | ||
process.versions = {}; | ||
function noop() {} | ||
process.on = noop; | ||
process.addListener = noop; | ||
process.once = noop; | ||
process.off = noop; | ||
process.removeListener = noop; | ||
process.removeAllListeners = noop; | ||
process.emit = noop; | ||
process.binding = function (name) { | ||
throw new Error('process.binding is not supported'); | ||
}; | ||
// TODO(shtylman) | ||
process.cwd = function () { return '/' }; | ||
process.chdir = function (dir) { | ||
throw new Error('process.chdir is not supported'); | ||
}; | ||
process.umask = function() { return 0; }; | ||
/***/ }, | ||
@@ -614,2 +706,8 @@ /* 10 */ | ||
/***/ }, | ||
/* 11 */ | ||
/***/ function(module, exports) { | ||
module.exports = __WEBPACK_EXTERNAL_MODULE_11__; | ||
/***/ } | ||
@@ -616,0 +714,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(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";function n(t){return t&&t.__esModule?t:{"default":t}}e.__esModule=!0;var o=r(9),u=n(o),i=r(2),s=n(i),a=s.default(u.default),c=a.Provider,f=a.connect;e.Provider=c,e.connect=f},function(t,e){"use strict";function r(t){return t.shape({subscribe:t.func.isRequired,dispatch:t.func.isRequired,getState:t.func.isRequired})}e.__esModule=!0,e.default=r,t.exports=e.default},function(t,e,r){"use strict";function n(t){return t&&t.__esModule?t:{"default":t}}function o(t){var e=i.default(t),r=a.default(t);return{Provider:e,connect:r}}e.__esModule=!0,e.default=o;var u=r(4),i=n(u),s=r(3),a=n(s);t.exports=e.default},function(t,e,r){"use strict";function n(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 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&&(t.__proto__=e)}function i(t){return t.displayName||t.name||"Component"}function s(t){var e=t.Component,r=t.PropTypes,n=p.default(r);return function(r,s,f){function p(t){var e=t.store.getState(),r=m(e);return g.default(y.default(r),"`mapStateToProps` must return an object. Instead received %s.",r),r}function l(t){var e=t.store.dispatch,r=j(e);return g.default(y.default(r),"`mapDispatchToProps` must return an object. Instead received %s.",r),r}function h(t,e,r){var n=w(t,e,r);return g.default(y.default(n),"`mergeProps` must return an object. Instead received %s.",n),n}var b=Boolean(r),m=r||x,j=y.default(s)?v.default(s):s||_,w=f||P,S=R++;return function(r){return function(e){function s(t,r){o(this,s),e.call(this,t,r),this.version=S,this.setUnderlyingRef=this.setUnderlyingRef.bind(this),this.stateProps=p(r),this.dispatchProps=l(r),this.state=this.computeNextState()}return u(s,e),s.prototype.shouldComponentUpdate=function(t,e){return!d.default(this.state,e)},a(s,null,[{key:"displayName",value:"Connect("+i(r)+")",enumerable:!0},{key:"DecoratedComponent",value:r,enumerable:!0},{key:"contextTypes",value:{store:n.isRequired},enumerable:!0}]),s.prototype.recomputeStateProps=function(){var t=p(this.context);return d.default(t,this.stateProps)?!1:(this.stateProps=t,!0)},s.prototype.recomputeDispatchProps=function(){var t=l(this.context);return d.default(t,this.dispatchProps)?!1:(this.dispatchProps=t,!0)},s.prototype.computeNextState=function(){var t=arguments.length<=0||void 0===arguments[0]?this.props:arguments[0];return h(this.stateProps,this.dispatchProps,t)},s.prototype.recomputeState=function(){var t=arguments.length<=0||void 0===arguments[0]?this.props:arguments[0],e=this.computeNextState(t);d.default(e,this.state)||this.setState(e)},s.prototype.isSubscribed=function(){return"function"==typeof this.unsubscribe},s.prototype.trySubscribe=function(){b&&!this.unsubscribe&&(this.unsubscribe=this.context.store.subscribe(this.handleChange.bind(this)),this.handleChange())},s.prototype.tryUnsubscribe=function(){this.unsubscribe&&(this.unsubscribe(),this.unsubscribe=null)},s.prototype.componentDidMount=function(){this.trySubscribe()},s.prototype.componentWillUpdate=function(){},s.prototype.componentWillReceiveProps=function(t){d.default(t,this.props)||this.recomputeState(t)},s.prototype.componentWillUnmount=function(){this.tryUnsubscribe()},s.prototype.handleChange=function(){this.recomputeStateProps()&&this.recomputeState()},s.prototype.getUnderlyingRef=function(){return this.underlyingRef},s.prototype.setUnderlyingRef=function(t){this.underlyingRef=t},s.prototype.render=function(){return t.createElement(r,c({ref:this.setUnderlyingRef},this.state))},s}(e)}}}e.__esModule=!0;var a=function(){function t(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}return function(e,r,n){return r&&t(e.prototype,r),n&&t(e,n),e}}(),c=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};e.default=s;var f=r(1),p=n(f),l=r(6),d=n(l),h=r(5),y=n(h),b=r(7),v=n(b),m=r(8),g=n(m),x=function(){return{}},_=function(t){return{dispatch:t}},P=function(t,e,r){return c({},r,t,e)},R=0;t.exports=e.default},function(t,e,r){"use strict";function n(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 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&&(t.__proto__=e)}function i(t){var e=t.Component,r=t.PropTypes,n=c.default(r);return function(t){function e(r,n){o(this,e),t.call(this,r,n),this.state={store:r.store}}return u(e,t),e.prototype.getChildContext=function(){return{store:this.state.store}},s(e,null,[{key:"childContextTypes",value:{store:n.isRequired},enumerable:!0},{key:"propTypes",value:{children:r.func.isRequired},enumerable:!0}]),e.prototype.componentWillReceiveProps=function(t){var e=this.state.store,r=t.store;if(e!==r){var n=r.getReducer();e.replaceReducer(n)}},e.prototype.render=function(){var t=this.props.children;return t()},e}(e)}e.__esModule=!0;var s=function(){function t(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}return function(e,r,n){return r&&t(e.prototype,r),n&&t(e,n),e}}();e.default=i;var a=r(1),c=n(a);t.exports=e.default},function(t,e){"use strict";function r(t){if(!t||"object"!=typeof t)return!1;var e="function"==typeof t.constructor?Object.getPrototypeOf(t):Object.prototype;if(null===e)return!0;var r=e.constructor;return"function"==typeof r&&r instanceof r&&n(r)===n(Object)}e.__esModule=!0,e.default=r;var n=function(t){return Function.prototype.toString.call(t)};t.exports=e.default},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,u=0;u<r.length;u++)if(!o.call(e,r[u])||t[r[u]]!==e[r[u]])return!1;return!0}e.__esModule=!0,e.default=r,t.exports=e.default},function(t,e,r){"use strict";function n(t){return function(e){return o.bindActionCreators(t,e)}}e.__esModule=!0,e.default=n;var o=r(10);t.exports=e.default},function(t,e,r){"use strict";var n=function(t,e,r,n,o,u,i,s){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 c=[r,n,o,u,i,s],f=0;a=new Error("Invariant Violation: "+e.replace(/%s/g,function(){return c[f++]}))}throw a.framesToPop=1,a}};t.exports=n},function(e,r){e.exports=t},function(t,r){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(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";function n(t){return t&&t.__esModule?t:{"default":t}}e.__esModule=!0;var o=r(10),u=n(o),i=r(2),s=n(i),a=s.default(u.default),c=a.Provider,p=a.connect;e.Provider=c,e.connect=p},function(t,e){"use strict";function r(t){return t.shape({subscribe:t.func.isRequired,dispatch:t.func.isRequired,getState:t.func.isRequired})}e.__esModule=!0,e.default=r,t.exports=e.default},function(t,e,r){"use strict";function n(t){return t&&t.__esModule?t:{"default":t}}function o(t){var e=i.default(t),r=a.default(t);return{Provider:e,connect:r}}e.__esModule=!0,e.default=o;var u=r(4),i=n(u),s=r(3),a=n(s);t.exports=e.default},function(t,e,r){(function(n){"use strict";function o(t){return t&&t.__esModule?t:{"default":t}}function u(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function i(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&&(t.__proto__=e)}function s(t){return t.displayName||t.name||"Component"}function a(t){var e=t.Component,r=t.PropTypes,o=l.default(r);return function(r,a,f){function l(t){var e=t.store.getState(),r=g(e);return _.default(v.default(r),"`mapStateToProps` must return an object. Instead received %s.",r),r}function d(t){var e=t.store.dispatch,r=j(e);return _.default(v.default(r),"`mapDispatchToProps` must return an object. Instead received %s.",r),r}function y(t,e,r){var n=R(t,e,r);return _.default(v.default(n),"`mergeProps` must return an object. Instead received %s.",n),n}var b=Boolean(r),g=r||x,j=v.default(a)?m.default(a):a||w,R=f||P,T=S++;return function(r){var a=function(e){function n(t,r){u(this,n),e.call(this,t,r),this.version=T,this.stateProps=l(r),this.dispatchProps=d(r),this.state=this.computeNextState()}return i(n,e),n.prototype.shouldComponentUpdate=function(t,e){return!h.default(this.state,e)},c(n,null,[{key:"displayName",value:"Connect("+s(r)+")",enumerable:!0},{key:"WrappedComponent",value:r,enumerable:!0},{key:"contextTypes",value:{store:o.isRequired},enumerable:!0}]),n.prototype.recomputeStateProps=function(){var t=l(this.context);return h.default(t,this.stateProps)?!1:(this.stateProps=t,!0)},n.prototype.recomputeDispatchProps=function(){var t=d(this.context);return h.default(t,this.dispatchProps)?!1:(this.dispatchProps=t,!0)},n.prototype.computeNextState=function(){var t=arguments.length<=0||void 0===arguments[0]?this.props:arguments[0];return y(this.stateProps,this.dispatchProps,t)},n.prototype.recomputeState=function(){var t=arguments.length<=0||void 0===arguments[0]?this.props:arguments[0],e=this.computeNextState(t);h.default(e,this.state)||this.setState(e)},n.prototype.isSubscribed=function(){return"function"==typeof this.unsubscribe},n.prototype.trySubscribe=function(){b&&!this.unsubscribe&&(this.unsubscribe=this.context.store.subscribe(this.handleChange.bind(this)),this.handleChange())},n.prototype.tryUnsubscribe=function(){this.unsubscribe&&(this.unsubscribe(),this.unsubscribe=null)},n.prototype.componentDidMount=function(){this.trySubscribe()},n.prototype.componentWillReceiveProps=function(t){h.default(t,this.props)||this.recomputeState(t)},n.prototype.componentWillUnmount=function(){this.tryUnsubscribe()},n.prototype.handleChange=function(){this.recomputeStateProps()&&this.recomputeState()},n.prototype.getWrappedInstance=function(){return this.refs.wrappedInstance},n.prototype.render=function(){return t.createElement(r,p({ref:"wrappedInstance"},this.state))},n}(e);return"undefined"!=typeof n&&"undefined"!=typeof n.env,"undefined"!=typeof __DEV__&&__DEV__&&(a.prototype.componentWillUpdate=function(){this.version!==T&&(this.version=T,this.trySubscribe(),this.recomputeStateProps(),this.recomputeDispatchProps(),this.recomputeState())}),a}}}e.__esModule=!0;var c=function(){function t(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}return function(e,r,n){return r&&t(e.prototype,r),n&&t(e,n),e}}(),p=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};e.default=a;var f=r(1),l=o(f),d=r(6),h=o(d),y=r(5),v=o(y),b=r(7),m=o(b),g=r(8),_=o(g),x=function(){return{}},w=function(t){return{dispatch:t}},P=function(t,e,r){return p({},r,t,e)},S=0;t.exports=e.default}).call(e,r(9))},function(t,e,r){"use strict";function n(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 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&&(t.__proto__=e)}function i(t){var e=t.Component,r=t.PropTypes,n=c.default(r);return function(t){function e(r,n){o(this,e),t.call(this,r,n),this.state={store:r.store}}return u(e,t),e.prototype.getChildContext=function(){return{store:this.state.store}},s(e,null,[{key:"childContextTypes",value:{store:n.isRequired},enumerable:!0},{key:"propTypes",value:{children:r.func.isRequired},enumerable:!0}]),e.prototype.componentWillReceiveProps=function(t){var e=this.state.store,r=t.store;if(e!==r){var n=r.getReducer();e.replaceReducer(n)}},e.prototype.render=function(){var t=this.props.children;return t()},e}(e)}e.__esModule=!0;var s=function(){function t(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}return function(e,r,n){return r&&t(e.prototype,r),n&&t(e,n),e}}();e.default=i;var a=r(1),c=n(a);t.exports=e.default},function(t,e){"use strict";function r(t){if(!t||"object"!=typeof t)return!1;var e="function"==typeof t.constructor?Object.getPrototypeOf(t):Object.prototype;if(null===e)return!0;var r=e.constructor;return"function"==typeof r&&r instanceof r&&n(r)===n(Object)}e.__esModule=!0,e.default=r;var n=function(t){return Function.prototype.toString.call(t)};t.exports=e.default},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,u=0;u<r.length;u++)if(!o.call(e,r[u])||t[r[u]]!==e[r[u]])return!1;return!0}e.__esModule=!0,e.default=r,t.exports=e.default},function(t,e,r){"use strict";function n(t){return function(e){return o.bindActionCreators(t,e)}}e.__esModule=!0,e.default=n;var o=r(11);t.exports=e.default},function(t,e,r){"use strict";var n=function(t,e,r,n,o,u,i,s){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 c=[r,n,o,u,i,s],p=0;a=new Error("Invariant Violation: "+e.replace(/%s/g,function(){return c[p++]}))}throw a.framesToPop=1,a}};t.exports=n},function(t,e){function r(){c=!1,i.length?a=i.concat(a):p=-1,a.length&&n()}function n(){if(!c){var t=setTimeout(r);c=!0;for(var e=a.length;e;){for(i=a,a=[];++p<e;)i[p].run();p=-1,e=a.length}i=null,c=!1,clearTimeout(t)}}function o(t,e){this.fun=t,this.array=e}function u(){}var i,s=t.exports={},a=[],c=!1,p=-1;s.nextTick=function(t){var e=new Array(arguments.length-1);if(arguments.length>1)for(var r=1;r<arguments.length;r++)e[r-1]=arguments[r];a.push(new o(t,e)),1!==a.length||c||setTimeout(n,0)},o.prototype.run=function(){this.fun.apply(null,this.array)},s.title="browser",s.browser=!0,s.env={},s.argv=[],s.version="",s.versions={},s.on=u,s.addListener=u,s.once=u,s.off=u,s.removeListener=u,s.removeAllListeners=u,s.emit=u,s.binding=function(t){throw new Error("process.binding is not supported")},s.cwd=function(){return"/"},s.chdir=function(t){throw new Error("process.chdir is not supported")},s.umask=function(){return 0}},function(e,r){e.exports=t},function(t,r){t.exports=e}])}); |
@@ -90,4 +90,4 @@ 'use strict'; | ||
return function (DecoratedComponent) { | ||
return (function (_Component) { | ||
return function wrapWithConnect(WrappedComponent) { | ||
var Connect = (function (_Component) { | ||
_inherits(Connect, _Component); | ||
@@ -101,7 +101,7 @@ | ||
key: 'displayName', | ||
value: 'Connect(' + getDisplayName(DecoratedComponent) + ')', | ||
value: 'Connect(' + getDisplayName(WrappedComponent) + ')', | ||
enumerable: true | ||
}, { | ||
key: 'DecoratedComponent', | ||
value: DecoratedComponent, | ||
key: 'WrappedComponent', | ||
value: WrappedComponent, | ||
enumerable: true | ||
@@ -121,4 +121,2 @@ }, { | ||
this.version = version; | ||
this.setUnderlyingRef = this.setUnderlyingRef.bind(this); | ||
this.stateProps = computeStateProps(context); | ||
@@ -186,19 +184,2 @@ this.dispatchProps = computeDispatchProps(context); | ||
Connect.prototype.componentWillUpdate = function componentWillUpdate() { | ||
if (process.env.NODE_ENV !== 'production') { | ||
if (this.version === version) { | ||
return; | ||
} | ||
// We are hot reloading! | ||
this.version = version; | ||
// Update the state and bindings. | ||
this.trySubscribe(); | ||
this.recomputeStateProps(); | ||
this.recomputeDispatchProps(); | ||
this.recomputeState(); | ||
} | ||
}; | ||
Connect.prototype.componentWillReceiveProps = function componentWillReceiveProps(nextProps) { | ||
@@ -220,12 +201,8 @@ if (!_utilsShallowEqual2['default'](nextProps, this.props)) { | ||
Connect.prototype.getUnderlyingRef = function getUnderlyingRef() { | ||
return this.underlyingRef; | ||
Connect.prototype.getWrappedInstance = function getWrappedInstance() { | ||
return this.refs.wrappedInstance; | ||
}; | ||
Connect.prototype.setUnderlyingRef = function setUnderlyingRef(instance) { | ||
this.underlyingRef = instance; | ||
}; | ||
Connect.prototype.render = function render() { | ||
return React.createElement(DecoratedComponent, _extends({ ref: this.setUnderlyingRef | ||
return React.createElement(WrappedComponent, _extends({ ref: 'wrappedInstance' | ||
}, this.state)); | ||
@@ -236,2 +213,26 @@ }; | ||
})(Component); | ||
if ( | ||
// Node-like CommonJS environments (Browserify, Webpack) | ||
typeof process !== 'undefined' && typeof process.env !== 'undefined' && process.env.NODE_ENV !== 'production' || | ||
// React Native | ||
typeof __DEV__ !== 'undefined' && __DEV__ //eslint-disable-line no-undef | ||
) { | ||
Connect.prototype.componentWillUpdate = function componentWillUpdate() { | ||
if (this.version === version) { | ||
return; | ||
} | ||
// We are hot reloading! | ||
this.version = version; | ||
// Update the state and bindings. | ||
this.trySubscribe(); | ||
this.recomputeStateProps(); | ||
this.recomputeDispatchProps(); | ||
this.recomputeState(); | ||
}; | ||
} | ||
return Connect; | ||
}; | ||
@@ -238,0 +239,0 @@ }; |
{ | ||
"name": "react-redux", | ||
"version": "0.6.0", | ||
"version": "0.7.0", | ||
"description": "React bindings for Redux", | ||
@@ -5,0 +5,0 @@ "main": "./lib/index.js", |
@@ -193,3 +193,3 @@ React Redux | ||
<Provider store={store}> | ||
{() => <MyRootComponent>} | ||
{() => <MyRootComponent />} | ||
</Provider>, | ||
@@ -196,0 +196,0 @@ rootEl |
@@ -288,3 +288,3 @@ import expect from 'expect'; | ||
it('should merge actionProps into DecoratedComponent', () => { | ||
it('should merge actionProps into WrappedComponent', () => { | ||
const store = createStore(() => ({ | ||
@@ -704,3 +704,3 @@ foo: 'bar' | ||
it('should expose the wrapped component as DecoratedComponent', () => { | ||
it('should expose the wrapped component as WrappedComponent', () => { | ||
class Container extends Component { | ||
@@ -715,3 +715,3 @@ render() { | ||
expect(decorated.DecoratedComponent).toBe(Container); | ||
expect(decorated.WrappedComponent).toBe(Container); | ||
}); | ||
@@ -750,5 +750,6 @@ | ||
expect(() => decorated.someInstanceMethod()).toThrow(); | ||
expect(decorated.getUnderlyingRef().someInstanceMethod()).toBe(someData); | ||
expect(decorated.getWrappedInstance().someInstanceMethod()).toBe(someData); | ||
expect(decorated.refs.wrappedInstance.someInstanceMethod()).toBe(someData); | ||
}); | ||
}); | ||
}); |
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
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
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
Deprecated
MaintenanceThe maintainer of the package marked it as deprecated. This could indicate that a single version should not be used, or that the package is no longer maintained and any new vulnerabilities will not be fixed.
Found 1 instance in 1 package
93434
1729
0
4