react-redux
Advanced tools
Comparing version 7.0.1 to 7.0.2
All notable changes are described on the [Releases](https://github.com/reduxjs/react-redux/releases) page. |
@@ -1,1 +0,1 @@ | ||
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("react"),require("redux"),require("react-dom")):"function"==typeof define&&define.amd?define(["exports","react","redux","react-dom"],t):t((e=e||self).ReactRedux={},e.React,e.Redux,e.ReactDOM)}(this,function(e,t,r,n){"use strict";var o="default"in t?t.default:t;function i(e,t){return e(t={exports:{}},t.exports),t.exports}var s="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";function u(){}function a(){}a.resetWarningCache=u;var c=i(function(e){e.exports=function(){function e(e,t,r,n,o,i){if(i!==s){var u=Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw u.name="Invariant Violation",u}}function t(){return e}e.isRequired=e;var r={array:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,elementType:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t,checkPropTypes:a,resetWarningCache:u};return r.PropTypes=r,r}()}),p=o.createContext(null);var f=function(e){e()},d=function(){return f},l=null,y={notify:function(){}};var h=function(){function e(e,t){this.store=e,this.parentSub=t,this.unsubscribe=null,this.listeners=y,this.handleChangeWrapper=this.handleChangeWrapper.bind(this)}var t=e.prototype;return t.addNestedSub=function(e){return this.trySubscribe(),this.listeners.subscribe(e)},t.notifyNestedSubs=function(){this.listeners.notify()},t.handleChangeWrapper=function(){this.onStateChange&&this.onStateChange()},t.isSubscribed=function(){return!!this.unsubscribe},t.trySubscribe=function(){var e,t,r;this.unsubscribe||(this.unsubscribe=this.parentSub?this.parentSub.addNestedSub(this.handleChangeWrapper):this.store.subscribe(this.handleChangeWrapper),this.listeners=(e=d(),t=[],r=[],{clear:function(){r=l,t=l},notify:function(){var n=t=r;e(function(){for(var e=0;n.length>e;e++)n[e]()})},get:function(){return r},subscribe:function(e){var n=!0;return r===t&&(r=t.slice()),r.push(e),function(){n&&t!==l&&(n=!1,r===t&&(r=t.slice()),r.splice(r.indexOf(e),1))}}}))},t.tryUnsubscribe=function(){this.unsubscribe&&(this.unsubscribe(),this.unsubscribe=null,this.listeners.clear(),this.listeners=y)},e}(),b=function(e){var t,r;function n(t){var r;r=e.call(this,t)||this;var n=t.store;r.notifySubscribers=r.notifySubscribers.bind(function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(r));var o=new h(n);return o.onStateChange=r.notifySubscribers,r.state={store:n,subscription:o},r.previousState=n.getState(),r}(t=n).prototype=Object.create((r=e).prototype),t.prototype.constructor=t,t.__proto__=r;var i=n.prototype;return i.componentDidMount=function(){this._isMounted=!0,this.state.subscription.trySubscribe(),this.previousState!==this.props.store.getState()&&this.state.subscription.notifyNestedSubs()},i.componentWillUnmount=function(){this.unsubscribe&&this.unsubscribe(),this.state.subscription.tryUnsubscribe(),this._isMounted=!1},i.componentDidUpdate=function(e){if(this.props.store!==e.store){this.state.subscription.tryUnsubscribe();var t=new h(this.props.store);t.onStateChange=this.notifySubscribers,this.setState({store:this.props.store,subscription:t})}},i.notifySubscribers=function(){this.state.subscription.notifyNestedSubs()},i.render=function(){return o.createElement((this.props.context||p).Provider,{value:this.state},this.props.children)},n}(t.Component);function m(){return(m=Object.assign||function(e){for(var t=1;arguments.length>t;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e}).apply(this,arguments)}function v(e,t){if(null==e)return{};var r,n,o={},i=Object.keys(e);for(n=0;i.length>n;n++)0>t.indexOf(r=i[n])&&(o[r]=e[r]);return o}b.propTypes={store:c.shape({subscribe:c.func.isRequired,dispatch:c.func.isRequired,getState:c.func.isRequired}),context:c.object,children:c.any};var P,S=i(function(e,t){Object.defineProperty(t,"__esModule",{value:!0});var r="function"==typeof Symbol&&Symbol.for,n=r?Symbol.for("react.element"):60103,o=r?Symbol.for("react.portal"):60106,i=r?Symbol.for("react.fragment"):60107,s=r?Symbol.for("react.strict_mode"):60108,u=r?Symbol.for("react.profiler"):60114,a=r?Symbol.for("react.provider"):60109,c=r?Symbol.for("react.context"):60110,p=r?Symbol.for("react.async_mode"):60111,f=r?Symbol.for("react.concurrent_mode"):60111,d=r?Symbol.for("react.forward_ref"):60112,l=r?Symbol.for("react.suspense"):60113,y=r?Symbol.for("react.memo"):60115,h=r?Symbol.for("react.lazy"):60116;function b(e){if("object"==typeof e&&null!==e){var t=e.$$typeof;switch(t){case n:switch(e=e.type){case p:case f:case i:case u:case s:case l:return e;default:switch(e=e&&e.$$typeof){case c:case d:case a:return e;default:return t}}case h:case y:case o:return t}}}function m(e){return b(e)===f}t.typeOf=b,t.AsyncMode=p,t.ConcurrentMode=f,t.ContextConsumer=c,t.ContextProvider=a,t.Element=n,t.ForwardRef=d,t.Fragment=i,t.Lazy=h,t.Memo=y,t.Portal=o,t.Profiler=u,t.StrictMode=s,t.Suspense=l,t.isValidElementType=function(e){return"string"==typeof e||"function"==typeof e||e===i||e===f||e===u||e===s||e===l||"object"==typeof e&&null!==e&&(e.$$typeof===h||e.$$typeof===y||e.$$typeof===a||e.$$typeof===c||e.$$typeof===d)},t.isAsyncMode=function(e){return m(e)||b(e)===p},t.isConcurrentMode=m,t.isContextConsumer=function(e){return b(e)===c},t.isContextProvider=function(e){return b(e)===a},t.isElement=function(e){return"object"==typeof e&&null!==e&&e.$$typeof===n},t.isForwardRef=function(e){return b(e)===d},t.isFragment=function(e){return b(e)===i},t.isLazy=function(e){return b(e)===h},t.isMemo=function(e){return b(e)===y},t.isPortal=function(e){return b(e)===o},t.isProfiler=function(e){return b(e)===u},t.isStrictMode=function(e){return b(e)===s},t.isSuspense=function(e){return b(e)===l}});(P=S)&&P.__esModule&&Object.prototype.hasOwnProperty.call(P,"default");var g=i(function(e){e.exports=S}),O=g.isContextConsumer,C={childContextTypes:!0,contextType:!0,contextTypes:!0,defaultProps:!0,displayName:!0,getDefaultProps:!0,getDerivedStateFromError:!0,getDerivedStateFromProps:!0,mixins:!0,propTypes:!0,type:!0},w={name:!0,length:!0,prototype:!0,caller:!0,callee:!0,arguments:!0,arity:!0},x={$$typeof:!0,compare:!0,defaultProps:!0,displayName:!0,propTypes:!0,type:!0},R={};function E(e){return g.isMemo(e)?x:R[e.$$typeof]||C}R[g.ForwardRef]={$$typeof:!0,render:!0,defaultProps:!0,displayName:!0,propTypes:!0};var M=Object.defineProperty,T=Object.getOwnPropertyNames,_=Object.getOwnPropertySymbols,j=Object.getOwnPropertyDescriptor,N=Object.getPrototypeOf,q=Object.prototype;var $=function e(t,r,n){if("string"!=typeof r){if(q){var o=N(r);o&&o!==q&&e(t,o,n)}var i=T(r);_&&(i=i.concat(_(r)));for(var s=E(t),u=E(r),a=0;i.length>a;++a){var c=i[a];if(!(w[c]||n&&n[c]||u&&u[c]||s&&s[c])){var p=j(r,c);try{M(t,c,p)}catch(e){}}}return t}return t},D=function(e,t,r,n,o,i,s,u){if(!e){var a;if(void 0===t)a=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,i,s,u],p=0;(a=Error(t.replace(/%s/g,function(){return c[p++]}))).name="Invariant Violation"}throw a.framesToPop=1,a}},F=[],W=[null,null];function U(e,t){return[t.payload,e[1]+1]}var k=function(){return[null,0]},A="undefined"!=typeof window?t.useLayoutEffect:t.useEffect;function H(e,r){void 0===r&&(r={});var n=r.getDisplayName,i=void 0===n?function(e){return"ConnectAdvanced("+e+")"}:n,s=r.methodName,u=void 0===s?"connectAdvanced":s,a=r.renderCountProp,c=void 0===a?void 0:a,f=r.shouldHandleStateChanges,d=void 0===f||f,l=r.storeKey,y=void 0===l?"store":l,b=r.withRef,P=void 0!==b&&b,S=r.forwardRef,g=void 0!==S&&S,C=r.context,w=void 0===C?p:C,x=v(r,["getDisplayName","methodName","renderCountProp","shouldHandleStateChanges","storeKey","withRef","forwardRef","context"]);D(void 0===c,"renderCountProp is removed. render counting is built into the latest React Dev Tools profiling extension"),D(!P,"withRef is removed. To access the wrapped instance, use a ref on the connected component");D("store"===y,"storeKey has been removed and does not do anything. To use a custom Redux store for specific components, create a custom React context with React.createContext(), and pass the context object to React Redux's Provider and specific components like: <Provider context={MyContext}><ConnectedComponent context={MyContext} /></Provider>. You may also pass a {context : MyContext} option to connect");var R=w;return function(r){var n=r.displayName||r.name||"Component",s=i(n),a=m({},x,{getDisplayName:i,methodName:u,renderCountProp:c,shouldHandleStateChanges:d,storeKey:y,displayName:s,wrappedComponentName:n,WrappedComponent:r}),p=x.pure;var f=p?t.useMemo:function(e){return e()};function l(n){var i=t.useMemo(function(){return[n.context,n.forwardedRef,v(n,["context","forwardedRef"])]},[n]),u=i[0],c=i[1],p=i[2],l=t.useMemo(function(){return u&&u.Consumer&&O(o.createElement(u.Consumer,null))?u:R},[u,R]),y=t.useContext(l),b=!!n.store;D(b||!!y&&!!y.store,'Could not find "store" in the context of "'+s+'". Either wrap the root component in a <Provider>, or pass a custom React context provider to <Provider> and the corresponding React context consumer to '+s+" in connect options.");var P=n.store||y.store,S=t.useMemo(function(){return function(t){return e(t.dispatch,a)}(P)},[P]),g=t.useMemo(function(){if(!d)return W;var e=new h(P,b?null:y.subscription),t=e.notifyNestedSubs.bind(e);return[e,t]},[P,b,y]),C=g[0],w=g[1],x=t.useMemo(function(){return b?y:m({},y,{subscription:C})},[b,y,C]),E=t.useReducer(U,F,k),M=E[0][0],T=E[1];if(M&&M.error)throw M.error;var _=t.useRef(),j=t.useRef(p),N=t.useRef(),q=f(function(){return N.current&&p===j.current?N.current:S(P.getState(),p)},[P,M,p]);return A(function(){j.current=p,_.current=q,N.current&&(N.current=null,w())}),t.useEffect(function(){if(d){var e=!1,t=null,r=function(){if(!e){var r,n,o=P.getState();try{r=S(o,j.current)}catch(e){n=e,t=e}n||(t=null),r===_.current?w():(_.current=r,N.current=r,T({type:"STORE_UPDATED",payload:{latestStoreState:o,error:n}}))}};C.onStateChange=r,C.trySubscribe(),r();return function(){if(e=!0,C.tryUnsubscribe(),t)throw t}}},[P,C,S]),t.useMemo(function(){var e=o.createElement(r,m({},q,{ref:c}));return d?o.createElement(l.Provider,{value:x},e):e},[l,r,q,c,x])}var b=p?o.memo(l):l;if(b.WrappedComponent=r,b.displayName=s,g){var P=o.forwardRef(function(e,t){return o.createElement(b,m({},e,{forwardedRef:t}))});return P.displayName=s,P.WrappedComponent=r,$(P,r)}return $(b,r)}}var I=Object.prototype.hasOwnProperty;function L(e,t){return e===t?0!==e||0!==t||1/e==1/t:e!=e&&t!=t}function K(e,t){if(L(e,t))return!0;if("object"!=typeof e||null===e||"object"!=typeof t||null===t)return!1;var r=Object.keys(e);if(r.length!==Object.keys(t).length)return!1;for(var n=0;r.length>n;n++)if(!I.call(t,r[n])||!L(e[r[n]],t[r[n]]))return!1;return!0}function z(e){return function(t,r){var n=e(t,r);function o(){return n}return o.dependsOnOwnProps=!1,o}}function V(e){return null!=e.dependsOnOwnProps?!!e.dependsOnOwnProps:1!==e.length}function Y(e,t){return function(t,r){var n=function(e,t){return n.dependsOnOwnProps?n.mapToProps(e,t):n.mapToProps(e)};return n.dependsOnOwnProps=!0,n.mapToProps=function(t,r){n.mapToProps=e,n.dependsOnOwnProps=V(e);var o=n(t,r);return"function"==typeof o&&(n.mapToProps=o,n.dependsOnOwnProps=V(o),o=n(t,r)),o},n}}function B(e,t,r){return m({},r,e,t)}var G=[function(e){return"function"==typeof e?function(e){return function(t,r){var n,o=r.pure,i=r.areMergedPropsEqual,s=!1;return function(t,r,u){var a=e(t,r,u);return s?o&&i(a,n)||(n=a):(s=!0,n=a),n}}}(e):void 0},function(e){return e?void 0:function(){return B}}];function J(e,t,r,n){return function(o,i){return r(e(o,i),t(n,i),i)}}function Q(e,t,r,n,o){var i,s,u,a,c,p=o.areStatesEqual,f=o.areOwnPropsEqual,d=o.areStatePropsEqual,l=!1;function y(o,l){var y,h,b=!f(l,s),m=!p(o,i);return i=o,s=l,b&&m?(u=e(i,s),t.dependsOnOwnProps&&(a=t(n,s)),c=r(u,a,s)):b?(e.dependsOnOwnProps&&(u=e(i,s)),t.dependsOnOwnProps&&(a=t(n,s)),c=r(u,a,s)):m?(y=e(i,s),h=!d(y,u),u=y,h&&(c=r(u,a,s)),c):c}return function(o,p){return l?y(o,p):(u=e(i=o,s=p),a=t(n,s),c=r(u,a,s),l=!0,c)}}function X(e,t){var r=t.initMapStateToProps,n=t.initMapDispatchToProps,o=t.initMergeProps,i=v(t,["initMapStateToProps","initMapDispatchToProps","initMergeProps"]),s=r(e,i),u=n(e,i),a=o(e,i);return(i.pure?Q:J)(s,u,a,e,i)}function Z(e,t,r){for(var n=t.length-1;n>=0;n--){var o=t[n](e);if(o)return o}return function(t,n){throw Error("Invalid value of type "+typeof e+" for "+r+" argument when connecting component "+n.wrappedComponentName+".")}}function ee(e,t){return e===t}var te,re,ne,oe,ie,se,ue,ae,ce,pe,fe,de,le=(oe=void 0===(ne=(re=void 0===te?{}:te).connectHOC)?H:ne,se=void 0===(ie=re.mapStateToPropsFactories)?[function(e){return"function"==typeof e?Y(e):void 0},function(e){return e?void 0:z(function(){return{}})}]:ie,ae=void 0===(ue=re.mapDispatchToPropsFactories)?[function(e){return"function"==typeof e?Y(e):void 0},function(e){return e?void 0:z(function(e){return{dispatch:e}})},function(e){return e&&"object"==typeof e?z(function(t){return r.bindActionCreators(e,t)}):void 0}]:ue,pe=void 0===(ce=re.mergePropsFactories)?G:ce,de=void 0===(fe=re.selectorFactory)?X:fe,function(e,t,r,n){void 0===n&&(n={});var o=n.pure,i=void 0===o||o,s=n.areStatesEqual,u=void 0===s?ee:s,a=n.areOwnPropsEqual,c=void 0===a?K:a,p=n.areStatePropsEqual,f=void 0===p?K:p,d=n.areMergedPropsEqual,l=void 0===d?K:d,y=v(n,["pure","areStatesEqual","areOwnPropsEqual","areStatePropsEqual","areMergedPropsEqual"]),h=Z(e,se,"mapStateToProps"),b=Z(t,ae,"mapDispatchToProps"),P=Z(r,pe,"mergeProps");return oe(de,m({methodName:"connect",getDisplayName:function(e){return"Connect("+e+")"},shouldHandleStateChanges:!!e,initMapStateToProps:h,initMapDispatchToProps:b,initMergeProps:P,pure:i,areStatesEqual:u,areOwnPropsEqual:c,areStatePropsEqual:f,areMergedPropsEqual:l},y))});f=n.unstable_batchedUpdates,e.batch=n.unstable_batchedUpdates,e.Provider=b,e.connectAdvanced=H,e.ReactReduxContext=p,e.connect=le,Object.defineProperty(e,"__esModule",{value:!0})}); | ||
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("react"),require("redux"),require("react-dom")):"function"==typeof define&&define.amd?define(["exports","react","redux","react-dom"],t):t((e=e||self).ReactRedux={},e.React,e.Redux,e.ReactDOM)}(this,function(e,t,r,n){"use strict";var o="default"in t?t.default:t;function i(e,t){return e(t={exports:{}},t.exports),t.exports}var s="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";function u(){}function a(){}a.resetWarningCache=u;var c=i(function(e){e.exports=function(){function e(e,t,r,n,o,i){if(i!==s){var u=Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw u.name="Invariant Violation",u}}function t(){return e}e.isRequired=e;var r={array:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,elementType:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t,checkPropTypes:a,resetWarningCache:u};return r.PropTypes=r,r}()}),p=o.createContext(null);var f=function(e){e()},d=function(){return f},l=null,y={notify:function(){}};var h=function(){function e(e,t){this.store=e,this.parentSub=t,this.unsubscribe=null,this.listeners=y,this.handleChangeWrapper=this.handleChangeWrapper.bind(this)}var t=e.prototype;return t.addNestedSub=function(e){return this.trySubscribe(),this.listeners.subscribe(e)},t.notifyNestedSubs=function(){this.listeners.notify()},t.handleChangeWrapper=function(){this.onStateChange&&this.onStateChange()},t.isSubscribed=function(){return!!this.unsubscribe},t.trySubscribe=function(){var e,t,r;this.unsubscribe||(this.unsubscribe=this.parentSub?this.parentSub.addNestedSub(this.handleChangeWrapper):this.store.subscribe(this.handleChangeWrapper),this.listeners=(e=d(),t=[],r=[],{clear:function(){r=l,t=l},notify:function(){var n=t=r;e(function(){for(var e=0;n.length>e;e++)n[e]()})},get:function(){return r},subscribe:function(e){var n=!0;return r===t&&(r=t.slice()),r.push(e),function(){n&&t!==l&&(n=!1,r===t&&(r=t.slice()),r.splice(r.indexOf(e),1))}}}))},t.tryUnsubscribe=function(){this.unsubscribe&&(this.unsubscribe(),this.unsubscribe=null,this.listeners.clear(),this.listeners=y)},e}(),b=function(e){var t,r;function n(t){var r;r=e.call(this,t)||this;var n=t.store;r.notifySubscribers=r.notifySubscribers.bind(function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(r));var o=new h(n);return o.onStateChange=r.notifySubscribers,r.state={store:n,subscription:o},r.previousState=n.getState(),r}(t=n).prototype=Object.create((r=e).prototype),t.prototype.constructor=t,t.__proto__=r;var i=n.prototype;return i.componentDidMount=function(){this._isMounted=!0,this.state.subscription.trySubscribe(),this.previousState!==this.props.store.getState()&&this.state.subscription.notifyNestedSubs()},i.componentWillUnmount=function(){this.unsubscribe&&this.unsubscribe(),this.state.subscription.tryUnsubscribe(),this._isMounted=!1},i.componentDidUpdate=function(e){if(this.props.store!==e.store){this.state.subscription.tryUnsubscribe();var t=new h(this.props.store);t.onStateChange=this.notifySubscribers,this.setState({store:this.props.store,subscription:t})}},i.notifySubscribers=function(){this.state.subscription.notifyNestedSubs()},i.render=function(){return o.createElement((this.props.context||p).Provider,{value:this.state},this.props.children)},n}(t.Component);function m(){return(m=Object.assign||function(e){for(var t=1;arguments.length>t;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e}).apply(this,arguments)}function v(e,t){if(null==e)return{};var r,n,o={},i=Object.keys(e);for(n=0;i.length>n;n++)0>t.indexOf(r=i[n])&&(o[r]=e[r]);return o}b.propTypes={store:c.shape({subscribe:c.func.isRequired,dispatch:c.func.isRequired,getState:c.func.isRequired}),context:c.object,children:c.any};var P,S=i(function(e,t){Object.defineProperty(t,"__esModule",{value:!0});var r="function"==typeof Symbol&&Symbol.for,n=r?Symbol.for("react.element"):60103,o=r?Symbol.for("react.portal"):60106,i=r?Symbol.for("react.fragment"):60107,s=r?Symbol.for("react.strict_mode"):60108,u=r?Symbol.for("react.profiler"):60114,a=r?Symbol.for("react.provider"):60109,c=r?Symbol.for("react.context"):60110,p=r?Symbol.for("react.async_mode"):60111,f=r?Symbol.for("react.concurrent_mode"):60111,d=r?Symbol.for("react.forward_ref"):60112,l=r?Symbol.for("react.suspense"):60113,y=r?Symbol.for("react.memo"):60115,h=r?Symbol.for("react.lazy"):60116;function b(e){if("object"==typeof e&&null!==e){var t=e.$$typeof;switch(t){case n:switch(e=e.type){case p:case f:case i:case u:case s:case l:return e;default:switch(e=e&&e.$$typeof){case c:case d:case a:return e;default:return t}}case h:case y:case o:return t}}}function m(e){return b(e)===f}t.typeOf=b,t.AsyncMode=p,t.ConcurrentMode=f,t.ContextConsumer=c,t.ContextProvider=a,t.Element=n,t.ForwardRef=d,t.Fragment=i,t.Lazy=h,t.Memo=y,t.Portal=o,t.Profiler=u,t.StrictMode=s,t.Suspense=l,t.isValidElementType=function(e){return"string"==typeof e||"function"==typeof e||e===i||e===f||e===u||e===s||e===l||"object"==typeof e&&null!==e&&(e.$$typeof===h||e.$$typeof===y||e.$$typeof===a||e.$$typeof===c||e.$$typeof===d)},t.isAsyncMode=function(e){return m(e)||b(e)===p},t.isConcurrentMode=m,t.isContextConsumer=function(e){return b(e)===c},t.isContextProvider=function(e){return b(e)===a},t.isElement=function(e){return"object"==typeof e&&null!==e&&e.$$typeof===n},t.isForwardRef=function(e){return b(e)===d},t.isFragment=function(e){return b(e)===i},t.isLazy=function(e){return b(e)===h},t.isMemo=function(e){return b(e)===y},t.isPortal=function(e){return b(e)===o},t.isProfiler=function(e){return b(e)===u},t.isStrictMode=function(e){return b(e)===s},t.isSuspense=function(e){return b(e)===l}});(P=S)&&P.__esModule&&Object.prototype.hasOwnProperty.call(P,"default");var g=i(function(e){e.exports=S}),O=g.isContextConsumer,C={childContextTypes:!0,contextType:!0,contextTypes:!0,defaultProps:!0,displayName:!0,getDefaultProps:!0,getDerivedStateFromError:!0,getDerivedStateFromProps:!0,mixins:!0,propTypes:!0,type:!0},w={name:!0,length:!0,prototype:!0,caller:!0,callee:!0,arguments:!0,arity:!0},x={$$typeof:!0,compare:!0,defaultProps:!0,displayName:!0,propTypes:!0,type:!0},M={};function R(e){return g.isMemo(e)?x:M[e.$$typeof]||C}M[g.ForwardRef]={$$typeof:!0,render:!0,defaultProps:!0,displayName:!0,propTypes:!0};var E=Object.defineProperty,T=Object.getOwnPropertyNames,j=Object.getOwnPropertySymbols,_=Object.getOwnPropertyDescriptor,N=Object.getPrototypeOf,q=Object.prototype;var $=function e(t,r,n){if("string"!=typeof r){if(q){var o=N(r);o&&o!==q&&e(t,o,n)}var i=T(r);j&&(i=i.concat(j(r)));for(var s=R(t),u=R(r),a=0;i.length>a;++a){var c=i[a];if(!(w[c]||n&&n[c]||u&&u[c]||s&&s[c])){var p=_(r,c);try{E(t,c,p)}catch(e){}}}return t}return t},D=function(e,t,r,n,o,i,s,u){if(!e){var a;if(void 0===t)a=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,i,s,u],p=0;(a=Error(t.replace(/%s/g,function(){return c[p++]}))).name="Invariant Violation"}throw a.framesToPop=1,a}},F=[],W=[null,null];function U(e,t){return[t.payload,e[1]+1]}var k=function(){return[null,0]},A="undefined"!=typeof window?t.useLayoutEffect:t.useEffect;function H(e,r){void 0===r&&(r={});var n=r.getDisplayName,i=void 0===n?function(e){return"ConnectAdvanced("+e+")"}:n,s=r.methodName,u=void 0===s?"connectAdvanced":s,a=r.renderCountProp,c=void 0===a?void 0:a,f=r.shouldHandleStateChanges,d=void 0===f||f,l=r.storeKey,y=void 0===l?"store":l,b=r.withRef,P=void 0!==b&&b,S=r.forwardRef,g=void 0!==S&&S,C=r.context,w=void 0===C?p:C,x=v(r,["getDisplayName","methodName","renderCountProp","shouldHandleStateChanges","storeKey","withRef","forwardRef","context"]);D(void 0===c,"renderCountProp is removed. render counting is built into the latest React Dev Tools profiling extension"),D(!P,"withRef is removed. To access the wrapped instance, use a ref on the connected component");D("store"===y,"storeKey has been removed and does not do anything. To use a custom Redux store for specific components, create a custom React context with React.createContext(), and pass the context object to React Redux's Provider and specific components like: <Provider context={MyContext}><ConnectedComponent context={MyContext} /></Provider>. You may also pass a {context : MyContext} option to connect");var M=w;return function(r){var n=r.displayName||r.name||"Component",s=i(n),a=m({},x,{getDisplayName:i,methodName:u,renderCountProp:c,shouldHandleStateChanges:d,storeKey:y,displayName:s,wrappedComponentName:n,WrappedComponent:r}),p=x.pure;var f=p?t.useMemo:function(e){return e()};function l(n){var i=t.useMemo(function(){return[n.context,n.forwardedRef,v(n,["context","forwardedRef"])]},[n]),u=i[0],c=i[1],p=i[2],l=t.useMemo(function(){return u&&u.Consumer&&O(o.createElement(u.Consumer,null))?u:M},[u,M]),y=t.useContext(l),b=!!n.store;D(b||!!y&&!!y.store,'Could not find "store" in the context of "'+s+'". Either wrap the root component in a <Provider>, or pass a custom React context provider to <Provider> and the corresponding React context consumer to '+s+" in connect options.");var P=n.store||y.store,S=t.useMemo(function(){return function(t){return e(t.dispatch,a)}(P)},[P]),g=t.useMemo(function(){if(!d)return W;var e=new h(P,b?null:y.subscription),t=e.notifyNestedSubs.bind(e);return[e,t]},[P,b,y]),C=g[0],w=g[1],x=t.useMemo(function(){return b?y:m({},y,{subscription:C})},[b,y,C]),R=t.useReducer(U,F,k),E=R[0][0],T=R[1];if(E&&E.error)throw E.error;var j=t.useRef(),_=t.useRef(p),N=t.useRef(),q=f(function(){return N.current&&p===_.current?N.current:S(P.getState(),p)},[P,E,p]);A(function(){_.current=p,j.current=q,N.current&&(N.current=null,w())}),A(function(){if(d){var e=!1,t=null,r=function(){if(!e){var r,n,o=P.getState();try{r=S(o,_.current)}catch(e){n=e,t=e}n||(t=null),r===j.current?w():(j.current=r,N.current=r,T({type:"STORE_UPDATED",payload:{latestStoreState:o,error:n}}))}};C.onStateChange=r,C.trySubscribe(),r();return function(){if(e=!0,C.tryUnsubscribe(),t)throw t}}},[P,C,S]);var $=t.useMemo(function(){return o.createElement(r,m({},q,{ref:c}))},[c,r,q]);return t.useMemo(function(){return d?o.createElement(l.Provider,{value:x},$):$},[l,$,x])}var b=p?o.memo(l):l;if(b.WrappedComponent=r,b.displayName=s,g){var P=o.forwardRef(function(e,t){return o.createElement(b,m({},e,{forwardedRef:t}))});return P.displayName=s,P.WrappedComponent=r,$(P,r)}return $(b,r)}}var I=Object.prototype.hasOwnProperty;function L(e,t){return e===t?0!==e||0!==t||1/e==1/t:e!=e&&t!=t}function K(e,t){if(L(e,t))return!0;if("object"!=typeof e||null===e||"object"!=typeof t||null===t)return!1;var r=Object.keys(e);if(r.length!==Object.keys(t).length)return!1;for(var n=0;r.length>n;n++)if(!I.call(t,r[n])||!L(e[r[n]],t[r[n]]))return!1;return!0}function z(e){return function(t,r){var n=e(t,r);function o(){return n}return o.dependsOnOwnProps=!1,o}}function V(e){return null!=e.dependsOnOwnProps?!!e.dependsOnOwnProps:1!==e.length}function Y(e,t){return function(t,r){var n=function(e,t){return n.dependsOnOwnProps?n.mapToProps(e,t):n.mapToProps(e)};return n.dependsOnOwnProps=!0,n.mapToProps=function(t,r){n.mapToProps=e,n.dependsOnOwnProps=V(e);var o=n(t,r);return"function"==typeof o&&(n.mapToProps=o,n.dependsOnOwnProps=V(o),o=n(t,r)),o},n}}function B(e,t,r){return m({},r,e,t)}var G=[function(e){return"function"==typeof e?function(e){return function(t,r){var n,o=r.pure,i=r.areMergedPropsEqual,s=!1;return function(t,r,u){var a=e(t,r,u);return s?o&&i(a,n)||(n=a):(s=!0,n=a),n}}}(e):void 0},function(e){return e?void 0:function(){return B}}];function J(e,t,r,n){return function(o,i){return r(e(o,i),t(n,i),i)}}function Q(e,t,r,n,o){var i,s,u,a,c,p=o.areStatesEqual,f=o.areOwnPropsEqual,d=o.areStatePropsEqual,l=!1;function y(o,l){var y,h,b=!f(l,s),m=!p(o,i);return i=o,s=l,b&&m?(u=e(i,s),t.dependsOnOwnProps&&(a=t(n,s)),c=r(u,a,s)):b?(e.dependsOnOwnProps&&(u=e(i,s)),t.dependsOnOwnProps&&(a=t(n,s)),c=r(u,a,s)):m?(y=e(i,s),h=!d(y,u),u=y,h&&(c=r(u,a,s)),c):c}return function(o,p){return l?y(o,p):(u=e(i=o,s=p),a=t(n,s),c=r(u,a,s),l=!0,c)}}function X(e,t){var r=t.initMapStateToProps,n=t.initMapDispatchToProps,o=t.initMergeProps,i=v(t,["initMapStateToProps","initMapDispatchToProps","initMergeProps"]),s=r(e,i),u=n(e,i),a=o(e,i);return(i.pure?Q:J)(s,u,a,e,i)}function Z(e,t,r){for(var n=t.length-1;n>=0;n--){var o=t[n](e);if(o)return o}return function(t,n){throw Error("Invalid value of type "+typeof e+" for "+r+" argument when connecting component "+n.wrappedComponentName+".")}}function ee(e,t){return e===t}var te,re,ne,oe,ie,se,ue,ae,ce,pe,fe,de,le=(oe=void 0===(ne=(re=void 0===te?{}:te).connectHOC)?H:ne,se=void 0===(ie=re.mapStateToPropsFactories)?[function(e){return"function"==typeof e?Y(e):void 0},function(e){return e?void 0:z(function(){return{}})}]:ie,ae=void 0===(ue=re.mapDispatchToPropsFactories)?[function(e){return"function"==typeof e?Y(e):void 0},function(e){return e?void 0:z(function(e){return{dispatch:e}})},function(e){return e&&"object"==typeof e?z(function(t){return r.bindActionCreators(e,t)}):void 0}]:ue,pe=void 0===(ce=re.mergePropsFactories)?G:ce,de=void 0===(fe=re.selectorFactory)?X:fe,function(e,t,r,n){void 0===n&&(n={});var o=n.pure,i=void 0===o||o,s=n.areStatesEqual,u=void 0===s?ee:s,a=n.areOwnPropsEqual,c=void 0===a?K:a,p=n.areStatePropsEqual,f=void 0===p?K:p,d=n.areMergedPropsEqual,l=void 0===d?K:d,y=v(n,["pure","areStatesEqual","areOwnPropsEqual","areStatePropsEqual","areMergedPropsEqual"]),h=Z(e,se,"mapStateToProps"),b=Z(t,ae,"mapDispatchToProps"),P=Z(r,pe,"mergeProps");return oe(de,m({methodName:"connect",getDisplayName:function(e){return"Connect("+e+")"},shouldHandleStateChanges:!!e,initMapStateToProps:h,initMapDispatchToProps:b,initMergeProps:P,pure:i,areStatesEqual:u,areOwnPropsEqual:c,areStatePropsEqual:f,areMergedPropsEqual:l},y))});f=n.unstable_batchedUpdates,Object.defineProperty(e,"batch",{enumerable:!0,get:function(){return n.unstable_batchedUpdates}}),e.Provider=b,e.ReactReduxContext=p,e.connect=le,e.connectAdvanced=H,Object.defineProperty(e,"__esModule",{value:!0})}); |
@@ -40,10 +40,10 @@ import _extends from "@babel/runtime/helpers/esm/extends"; | ||
compute new props from state, props, and dispatch. For example: | ||
export default connectAdvanced((dispatch, options) => (state, props) => ({ | ||
export default connectAdvanced((dispatch, options) => (state, props) => ({ | ||
thing: state.things[props.thingId], | ||
saveThing: fields => dispatch(actionCreators.saveThing(props.thingId, fields)), | ||
}))(YourComponent) | ||
Access to dispatch is provided to the factory so selectorFactories can bind actionCreators | ||
Access to dispatch is provided to the factory so selectorFactories can bind actionCreators | ||
outside of their selector as an optimization. Options passed to connectAdvanced are passed to | ||
the selectorFactory, along with displayName and WrappedComponent, as the second argument. | ||
Note that selectorFactory is responsible for all caching/memoization of inbound and outbound | ||
Note that selectorFactory is responsible for all caching/memoization of inbound and outbound | ||
props. Do not use connectAdvanced directly without memoizing results between calls to your | ||
@@ -227,3 +227,3 @@ selector, otherwise the Connect component will re-render on every state or props change. | ||
useEffect(function () { | ||
useIsomorphicLayoutEffect(function () { | ||
// If we're not subscribed to the store, nothing to do here | ||
@@ -303,11 +303,11 @@ if (!shouldHandleStateChanges) return; // Capture values for checking if and when this component unmounts | ||
// We memoize the elements for the rendered child component as an optimization. | ||
// If React sees the exact same element reference as last time, it bails out of re-rendering | ||
// that child, same as if it was wrapped in React.memo() or returned false from shouldComponentUpdate. | ||
var renderedChild = useMemo(function () { | ||
// Render the actual child component | ||
var renderedWrappedComponent = React.createElement(WrappedComponent, _extends({}, actualChildProps, { | ||
var renderedWrappedComponent = useMemo(function () { | ||
return React.createElement(WrappedComponent, _extends({}, actualChildProps, { | ||
ref: forwardedRef | ||
})); | ||
}, [forwardedRef, WrappedComponent, actualChildProps]); // If React sees the exact same element reference as last time, it bails out of re-rendering | ||
// that child, same as if it was wrapped in React.memo() or returned false from shouldComponentUpdate. | ||
var renderedChild = useMemo(function () { | ||
if (shouldHandleStateChanges) { | ||
@@ -323,3 +323,3 @@ // If this component is subscribed to store updates, we need to pass its own | ||
return renderedWrappedComponent; | ||
}, [ContextToUse, WrappedComponent, actualChildProps, forwardedRef, overriddenContextValue]); | ||
}, [ContextToUse, renderedWrappedComponent, overriddenContextValue]); | ||
return renderedChild; | ||
@@ -326,0 +326,0 @@ } // If we're in "pure" mode, ensure our wrapper component only re-renders when incoming props have changed. |
@@ -0,0 +0,0 @@ import _extends from "@babel/runtime/helpers/esm/extends"; |
@@ -0,0 +0,0 @@ /** |
@@ -10,7 +10,7 @@ "use strict"; | ||
exports.Provider = _Provider.default; | ||
exports.Provider = _Provider["default"]; | ||
var _connectAdvanced = _interopRequireDefault(require("./components/connectAdvanced")); | ||
exports.connectAdvanced = _connectAdvanced.default; | ||
exports.connectAdvanced = _connectAdvanced["default"]; | ||
@@ -23,3 +23,3 @@ var _Context = require("./components/Context"); | ||
exports.connect = _connect.default; | ||
exports.connect = _connect["default"]; | ||
@@ -26,0 +26,0 @@ var _batch = require("./utils/batch"); |
@@ -8,3 +8,3 @@ "use strict"; | ||
exports.__esModule = true; | ||
exports.default = connectAdvanced; | ||
exports["default"] = connectAdvanced; | ||
@@ -59,10 +59,10 @@ var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends")); | ||
compute new props from state, props, and dispatch. For example: | ||
export default connectAdvanced((dispatch, options) => (state, props) => ({ | ||
export default connectAdvanced((dispatch, options) => (state, props) => ({ | ||
thing: state.things[props.thingId], | ||
saveThing: fields => dispatch(actionCreators.saveThing(props.thingId, fields)), | ||
}))(YourComponent) | ||
Access to dispatch is provided to the factory so selectorFactories can bind actionCreators | ||
Access to dispatch is provided to the factory so selectorFactories can bind actionCreators | ||
outside of their selector as an optimization. Options passed to connectAdvanced are passed to | ||
the selectorFactory, along with displayName and WrappedComponent, as the second argument. | ||
Note that selectorFactory is responsible for all caching/memoization of inbound and outbound | ||
Note that selectorFactory is responsible for all caching/memoization of inbound and outbound | ||
props. Do not use connectAdvanced directly without memoizing results between calls to your | ||
@@ -96,11 +96,11 @@ selector, otherwise the Connect component will re-render on every state or props change. | ||
context = _ref2$context === void 0 ? _Context.ReactReduxContext : _ref2$context, | ||
connectOptions = (0, _objectWithoutPropertiesLoose2.default)(_ref2, ["getDisplayName", "methodName", "renderCountProp", "shouldHandleStateChanges", "storeKey", "withRef", "forwardRef", "context"]); | ||
(0, _invariant.default)(renderCountProp === undefined, "renderCountProp is removed. render counting is built into the latest React Dev Tools profiling extension"); | ||
(0, _invariant.default)(!withRef, 'withRef is removed. To access the wrapped instance, use a ref on the connected component'); | ||
connectOptions = (0, _objectWithoutPropertiesLoose2["default"])(_ref2, ["getDisplayName", "methodName", "renderCountProp", "shouldHandleStateChanges", "storeKey", "withRef", "forwardRef", "context"]); | ||
(0, _invariant["default"])(renderCountProp === undefined, "renderCountProp is removed. render counting is built into the latest React Dev Tools profiling extension"); | ||
(0, _invariant["default"])(!withRef, 'withRef is removed. To access the wrapped instance, use a ref on the connected component'); | ||
var customStoreWarningMessage = 'To use a custom Redux store for specific components, create a custom React context with ' + "React.createContext(), and pass the context object to React Redux's Provider and specific components" + ' like: <Provider context={MyContext}><ConnectedComponent context={MyContext} /></Provider>. ' + 'You may also pass a {context : MyContext} option to connect'; | ||
(0, _invariant.default)(storeKey === 'store', 'storeKey has been removed and does not do anything. ' + customStoreWarningMessage); | ||
(0, _invariant["default"])(storeKey === 'store', 'storeKey has been removed and does not do anything. ' + customStoreWarningMessage); | ||
var Context = context; | ||
return function wrapWithConnect(WrappedComponent) { | ||
if (process.env.NODE_ENV !== 'production') { | ||
(0, _invariant.default)((0, _reactIs.isValidElementType)(WrappedComponent), "You must pass a component to the function returned by " + (methodName + ". Instead received " + stringifyComponent(WrappedComponent))); | ||
(0, _invariant["default"])((0, _reactIs.isValidElementType)(WrappedComponent), "You must pass a component to the function returned by " + (methodName + ". Instead received " + stringifyComponent(WrappedComponent))); | ||
} | ||
@@ -110,3 +110,3 @@ | ||
var displayName = getDisplayName(wrappedComponentName); | ||
var selectorFactoryOptions = (0, _extends2.default)({}, connectOptions, { | ||
var selectorFactoryOptions = (0, _extends2["default"])({}, connectOptions, { | ||
getDisplayName: getDisplayName, | ||
@@ -141,3 +141,3 @@ methodName: methodName, | ||
forwardedRef = props.forwardedRef, | ||
wrapperProps = (0, _objectWithoutPropertiesLoose2.default)(props, ["context", "forwardedRef"]); | ||
wrapperProps = (0, _objectWithoutPropertiesLoose2["default"])(props, ["context", "forwardedRef"]); | ||
return [context, forwardedRef, wrapperProps]; | ||
@@ -152,3 +152,3 @@ }, [props]), | ||
// Memoize the check that determines which context instance we should use. | ||
return propsContext && propsContext.Consumer && (0, _reactIs.isContextConsumer)(_react.default.createElement(propsContext.Consumer, null)) ? propsContext : Context; | ||
return propsContext && propsContext.Consumer && (0, _reactIs.isContextConsumer)(_react["default"].createElement(propsContext.Consumer, null)) ? propsContext : Context; | ||
}, [propsContext, Context]); // Retrieve the store and ancestor subscription via context, if available | ||
@@ -160,3 +160,3 @@ | ||
var didStoreComeFromContext = Boolean(contextValue) && Boolean(contextValue.store); | ||
(0, _invariant.default)(didStoreComeFromProps || didStoreComeFromContext, "Could not find \"store\" in the context of " + ("\"" + displayName + "\". Either wrap the root component in a <Provider>, ") + "or pass a custom React context provider to <Provider> and the corresponding " + ("React context consumer to " + displayName + " in connect options.")); | ||
(0, _invariant["default"])(didStoreComeFromProps || didStoreComeFromContext, "Could not find \"store\" in the context of " + ("\"" + displayName + "\". Either wrap the root component in a <Provider>, ") + "or pass a custom React context provider to <Provider> and the corresponding " + ("React context consumer to " + displayName + " in connect options.")); | ||
var store = props.store || contextValue.store; | ||
@@ -173,3 +173,3 @@ var childPropsSelector = (0, _react.useMemo)(function () { | ||
var subscription = new _Subscription.default(store, didStoreComeFromProps ? null : contextValue.subscription); // `notifyNestedSubs` is duplicated to handle the case where the component is unmounted in | ||
var subscription = new _Subscription["default"](store, didStoreComeFromProps ? null : contextValue.subscription); // `notifyNestedSubs` is duplicated to handle the case where the component is unmounted in | ||
// the middle of the notification loop, where `subscription` will then be null. This can | ||
@@ -197,3 +197,3 @@ // probably be avoided if Subscription's listeners logic is changed to not call listeners | ||
return (0, _extends2.default)({}, contextValue, { | ||
return (0, _extends2["default"])({}, contextValue, { | ||
subscription: subscription | ||
@@ -249,3 +249,3 @@ }); | ||
(0, _react.useEffect)(function () { | ||
useIsomorphicLayoutEffect(function () { | ||
// If we're not subscribed to the store, nothing to do here | ||
@@ -325,11 +325,11 @@ if (!shouldHandleStateChanges) return; // Capture values for checking if and when this component unmounts | ||
// We memoize the elements for the rendered child component as an optimization. | ||
// If React sees the exact same element reference as last time, it bails out of re-rendering | ||
// that child, same as if it was wrapped in React.memo() or returned false from shouldComponentUpdate. | ||
var renderedChild = (0, _react.useMemo)(function () { | ||
// Render the actual child component | ||
var renderedWrappedComponent = _react.default.createElement(WrappedComponent, (0, _extends2.default)({}, actualChildProps, { | ||
var renderedWrappedComponent = (0, _react.useMemo)(function () { | ||
return _react["default"].createElement(WrappedComponent, (0, _extends2["default"])({}, actualChildProps, { | ||
ref: forwardedRef | ||
})); | ||
}, [forwardedRef, WrappedComponent, actualChildProps]); // If React sees the exact same element reference as last time, it bails out of re-rendering | ||
// that child, same as if it was wrapped in React.memo() or returned false from shouldComponentUpdate. | ||
var renderedChild = (0, _react.useMemo)(function () { | ||
if (shouldHandleStateChanges) { | ||
@@ -339,3 +339,3 @@ // If this component is subscribed to store updates, we need to pass its own | ||
// Context instance, and putting a different value into the context. | ||
return _react.default.createElement(ContextToUse.Provider, { | ||
return _react["default"].createElement(ContextToUse.Provider, { | ||
value: overriddenContextValue | ||
@@ -346,3 +346,3 @@ }, renderedWrappedComponent); | ||
return renderedWrappedComponent; | ||
}, [ContextToUse, WrappedComponent, actualChildProps, forwardedRef, overriddenContextValue]); | ||
}, [ContextToUse, renderedWrappedComponent, overriddenContextValue]); | ||
return renderedChild; | ||
@@ -352,3 +352,3 @@ } // If we're in "pure" mode, ensure our wrapper component only re-renders when incoming props have changed. | ||
var Connect = pure ? _react.default.memo(ConnectFunction) : ConnectFunction; | ||
var Connect = pure ? _react["default"].memo(ConnectFunction) : ConnectFunction; | ||
Connect.WrappedComponent = WrappedComponent; | ||
@@ -358,4 +358,4 @@ Connect.displayName = displayName; | ||
if (forwardRef) { | ||
var forwarded = _react.default.forwardRef(function forwardConnectRef(props, ref) { | ||
return _react.default.createElement(Connect, (0, _extends2.default)({}, props, { | ||
var forwarded = _react["default"].forwardRef(function forwardConnectRef(props, ref) { | ||
return _react["default"].createElement(Connect, (0, _extends2["default"])({}, props, { | ||
forwardedRef: ref | ||
@@ -367,7 +367,7 @@ })); | ||
forwarded.WrappedComponent = WrappedComponent; | ||
return (0, _hoistNonReactStatics.default)(forwarded, WrappedComponent); | ||
return (0, _hoistNonReactStatics["default"])(forwarded, WrappedComponent); | ||
} | ||
return (0, _hoistNonReactStatics.default)(Connect, WrappedComponent); | ||
return (0, _hoistNonReactStatics["default"])(Connect, WrappedComponent); | ||
}; | ||
} |
@@ -6,10 +6,10 @@ "use strict"; | ||
exports.__esModule = true; | ||
exports.default = exports.ReactReduxContext = void 0; | ||
exports["default"] = exports.ReactReduxContext = void 0; | ||
var _react = _interopRequireDefault(require("react")); | ||
var ReactReduxContext = _react.default.createContext(null); | ||
var ReactReduxContext = _react["default"].createContext(null); | ||
exports.ReactReduxContext = ReactReduxContext; | ||
var _default = ReactReduxContext; | ||
exports.default = _default; | ||
exports["default"] = _default; |
@@ -8,3 +8,3 @@ "use strict"; | ||
exports.__esModule = true; | ||
exports.default = void 0; | ||
exports["default"] = void 0; | ||
@@ -26,3 +26,3 @@ var _assertThisInitialized2 = _interopRequireDefault(require("@babel/runtime/helpers/assertThisInitialized")); | ||
function (_Component) { | ||
(0, _inheritsLoose2.default)(Provider, _Component); | ||
(0, _inheritsLoose2["default"])(Provider, _Component); | ||
@@ -34,4 +34,4 @@ function Provider(props) { | ||
var store = props.store; | ||
_this.notifySubscribers = _this.notifySubscribers.bind((0, _assertThisInitialized2.default)(_this)); | ||
var subscription = new _Subscription.default(store); | ||
_this.notifySubscribers = _this.notifySubscribers.bind((0, _assertThisInitialized2["default"])(_this)); | ||
var subscription = new _Subscription["default"](store); | ||
subscription.onStateChange = _this.notifySubscribers; | ||
@@ -66,3 +66,3 @@ _this.state = { | ||
this.state.subscription.tryUnsubscribe(); | ||
var subscription = new _Subscription.default(this.props.store); | ||
var subscription = new _Subscription["default"](this.props.store); | ||
subscription.onStateChange = this.notifySubscribers; | ||
@@ -82,3 +82,3 @@ this.setState({ | ||
var Context = this.props.context || _Context.ReactReduxContext; | ||
return _react.default.createElement(Context.Provider, { | ||
return _react["default"].createElement(Context.Provider, { | ||
value: this.state | ||
@@ -92,11 +92,11 @@ }, this.props.children); | ||
Provider.propTypes = { | ||
store: _propTypes.default.shape({ | ||
subscribe: _propTypes.default.func.isRequired, | ||
dispatch: _propTypes.default.func.isRequired, | ||
getState: _propTypes.default.func.isRequired | ||
store: _propTypes["default"].shape({ | ||
subscribe: _propTypes["default"].func.isRequired, | ||
dispatch: _propTypes["default"].func.isRequired, | ||
getState: _propTypes["default"].func.isRequired | ||
}), | ||
context: _propTypes.default.object, | ||
children: _propTypes.default.any | ||
context: _propTypes["default"].object, | ||
children: _propTypes["default"].any | ||
}; | ||
var _default = Provider; | ||
exports.default = _default; | ||
exports["default"] = _default; |
@@ -7,3 +7,3 @@ "use strict"; | ||
exports.createConnect = createConnect; | ||
exports.default = void 0; | ||
exports["default"] = void 0; | ||
@@ -62,11 +62,11 @@ var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends")); | ||
_ref$connectHOC = _ref.connectHOC, | ||
connectHOC = _ref$connectHOC === void 0 ? _connectAdvanced.default : _ref$connectHOC, | ||
connectHOC = _ref$connectHOC === void 0 ? _connectAdvanced["default"] : _ref$connectHOC, | ||
_ref$mapStateToPropsF = _ref.mapStateToPropsFactories, | ||
mapStateToPropsFactories = _ref$mapStateToPropsF === void 0 ? _mapStateToProps.default : _ref$mapStateToPropsF, | ||
mapStateToPropsFactories = _ref$mapStateToPropsF === void 0 ? _mapStateToProps["default"] : _ref$mapStateToPropsF, | ||
_ref$mapDispatchToPro = _ref.mapDispatchToPropsFactories, | ||
mapDispatchToPropsFactories = _ref$mapDispatchToPro === void 0 ? _mapDispatchToProps.default : _ref$mapDispatchToPro, | ||
mapDispatchToPropsFactories = _ref$mapDispatchToPro === void 0 ? _mapDispatchToProps["default"] : _ref$mapDispatchToPro, | ||
_ref$mergePropsFactor = _ref.mergePropsFactories, | ||
mergePropsFactories = _ref$mergePropsFactor === void 0 ? _mergeProps.default : _ref$mergePropsFactor, | ||
mergePropsFactories = _ref$mergePropsFactor === void 0 ? _mergeProps["default"] : _ref$mergePropsFactor, | ||
_ref$selectorFactory = _ref.selectorFactory, | ||
selectorFactory = _ref$selectorFactory === void 0 ? _selectorFactory.default : _ref$selectorFactory; | ||
selectorFactory = _ref$selectorFactory === void 0 ? _selectorFactory["default"] : _ref$selectorFactory; | ||
@@ -84,12 +84,12 @@ return function connect(mapStateToProps, mapDispatchToProps, mergeProps, _ref2) { | ||
_ref3$areOwnPropsEqua = _ref3.areOwnPropsEqual, | ||
areOwnPropsEqual = _ref3$areOwnPropsEqua === void 0 ? _shallowEqual.default : _ref3$areOwnPropsEqua, | ||
areOwnPropsEqual = _ref3$areOwnPropsEqua === void 0 ? _shallowEqual["default"] : _ref3$areOwnPropsEqua, | ||
_ref3$areStatePropsEq = _ref3.areStatePropsEqual, | ||
areStatePropsEqual = _ref3$areStatePropsEq === void 0 ? _shallowEqual.default : _ref3$areStatePropsEq, | ||
areStatePropsEqual = _ref3$areStatePropsEq === void 0 ? _shallowEqual["default"] : _ref3$areStatePropsEq, | ||
_ref3$areMergedPropsE = _ref3.areMergedPropsEqual, | ||
areMergedPropsEqual = _ref3$areMergedPropsE === void 0 ? _shallowEqual.default : _ref3$areMergedPropsE, | ||
extraOptions = (0, _objectWithoutPropertiesLoose2.default)(_ref3, ["pure", "areStatesEqual", "areOwnPropsEqual", "areStatePropsEqual", "areMergedPropsEqual"]); | ||
areMergedPropsEqual = _ref3$areMergedPropsE === void 0 ? _shallowEqual["default"] : _ref3$areMergedPropsE, | ||
extraOptions = (0, _objectWithoutPropertiesLoose2["default"])(_ref3, ["pure", "areStatesEqual", "areOwnPropsEqual", "areStatePropsEqual", "areMergedPropsEqual"]); | ||
var initMapStateToProps = match(mapStateToProps, mapStateToPropsFactories, 'mapStateToProps'); | ||
var initMapDispatchToProps = match(mapDispatchToProps, mapDispatchToPropsFactories, 'mapDispatchToProps'); | ||
var initMergeProps = match(mergeProps, mergePropsFactories, 'mergeProps'); | ||
return connectHOC(selectorFactory, (0, _extends2.default)({ | ||
return connectHOC(selectorFactory, (0, _extends2["default"])({ | ||
// used in error messages | ||
@@ -118,2 +118,2 @@ methodName: 'connect', | ||
exports.default = _default; | ||
exports["default"] = _default; |
@@ -7,3 +7,3 @@ "use strict"; | ||
exports.whenMapDispatchToPropsIsObject = whenMapDispatchToPropsIsObject; | ||
exports.default = void 0; | ||
exports["default"] = void 0; | ||
@@ -33,2 +33,2 @@ var _redux = require("redux"); | ||
var _default = [whenMapDispatchToPropsIsFunction, whenMapDispatchToPropsIsMissing, whenMapDispatchToPropsIsObject]; | ||
exports.default = _default; | ||
exports["default"] = _default; |
@@ -6,3 +6,3 @@ "use strict"; | ||
exports.whenMapStateToPropsIsMissing = whenMapStateToPropsIsMissing; | ||
exports.default = void 0; | ||
exports["default"] = void 0; | ||
@@ -22,2 +22,2 @@ var _wrapMapToProps = require("./wrapMapToProps"); | ||
var _default = [whenMapStateToPropsIsFunction, whenMapStateToPropsIsMissing]; | ||
exports.default = _default; | ||
exports["default"] = _default; |
@@ -10,3 +10,3 @@ "use strict"; | ||
exports.whenMergePropsIsOmitted = whenMergePropsIsOmitted; | ||
exports.default = void 0; | ||
exports["default"] = void 0; | ||
@@ -18,3 +18,3 @@ var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends")); | ||
function defaultMergeProps(stateProps, dispatchProps, ownProps) { | ||
return (0, _extends2.default)({}, ownProps, stateProps, dispatchProps); | ||
return (0, _extends2["default"])({}, ownProps, stateProps, dispatchProps); | ||
} | ||
@@ -37,3 +37,3 @@ | ||
mergedProps = nextMergedProps; | ||
if (process.env.NODE_ENV !== 'production') (0, _verifyPlainObject.default)(mergedProps, displayName, 'mergeProps'); | ||
if (process.env.NODE_ENV !== 'production') (0, _verifyPlainObject["default"])(mergedProps, displayName, 'mergeProps'); | ||
} | ||
@@ -57,2 +57,2 @@ | ||
var _default = [whenMergePropsIsFunction, whenMergePropsIsOmitted]; | ||
exports.default = _default; | ||
exports["default"] = _default; |
@@ -8,3 +8,3 @@ "use strict"; | ||
exports.pureFinalPropsSelectorFactory = pureFinalPropsSelectorFactory; | ||
exports.default = finalPropsSelectorFactory; | ||
exports["default"] = finalPropsSelectorFactory; | ||
@@ -89,3 +89,3 @@ var _objectWithoutPropertiesLoose2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutPropertiesLoose")); | ||
initMergeProps = _ref2.initMergeProps, | ||
options = (0, _objectWithoutPropertiesLoose2.default)(_ref2, ["initMapStateToProps", "initMapDispatchToProps", "initMergeProps"]); | ||
options = (0, _objectWithoutPropertiesLoose2["default"])(_ref2, ["initMapStateToProps", "initMapDispatchToProps", "initMergeProps"]); | ||
var mapStateToProps = initMapStateToProps(dispatch, options); | ||
@@ -96,3 +96,3 @@ var mapDispatchToProps = initMapDispatchToProps(dispatch, options); | ||
if (process.env.NODE_ENV !== 'production') { | ||
(0, _verifySubselectors.default)(mapStateToProps, mapDispatchToProps, mergeProps, options.displayName); | ||
(0, _verifySubselectors["default"])(mapStateToProps, mapDispatchToProps, mergeProps, options.displayName); | ||
} | ||
@@ -99,0 +99,0 @@ |
@@ -6,3 +6,3 @@ "use strict"; | ||
exports.__esModule = true; | ||
exports.default = verifySubselectors; | ||
exports["default"] = verifySubselectors; | ||
@@ -16,3 +16,3 @@ var _warning = _interopRequireDefault(require("../utils/warning")); | ||
if (!selector.hasOwnProperty('dependsOnOwnProps')) { | ||
(0, _warning.default)("The selector for " + methodName + " of " + displayName + " did not specify a value for dependsOnOwnProps."); | ||
(0, _warning["default"])("The selector for " + methodName + " of " + displayName + " did not specify a value for dependsOnOwnProps."); | ||
} | ||
@@ -19,0 +19,0 @@ } |
@@ -70,3 +70,3 @@ "use strict"; | ||
if (process.env.NODE_ENV !== 'production') (0, _verifyPlainObject.default)(props, displayName, methodName); | ||
if (process.env.NODE_ENV !== 'production') (0, _verifyPlainObject["default"])(props, displayName, methodName); | ||
return props; | ||
@@ -73,0 +73,0 @@ }; |
@@ -9,7 +9,7 @@ "use strict"; | ||
exports.Provider = _Provider.default; | ||
exports.Provider = _Provider["default"]; | ||
var _connectAdvanced = _interopRequireDefault(require("./components/connectAdvanced")); | ||
exports.connectAdvanced = _connectAdvanced.default; | ||
exports.connectAdvanced = _connectAdvanced["default"]; | ||
@@ -22,3 +22,3 @@ var _Context = require("./components/Context"); | ||
exports.connect = _connect.default; | ||
exports.connect = _connect["default"]; | ||
@@ -25,0 +25,0 @@ var _batch = require("./utils/batch"); |
"use strict"; | ||
exports.__esModule = true; | ||
exports.default = isPlainObject; | ||
exports["default"] = isPlainObject; | ||
@@ -6,0 +6,0 @@ /** |
"use strict"; | ||
exports.__esModule = true; | ||
exports.default = shallowEqual; | ||
exports["default"] = shallowEqual; | ||
var hasOwn = Object.prototype.hasOwnProperty; | ||
@@ -6,0 +6,0 @@ |
"use strict"; | ||
exports.__esModule = true; | ||
exports.default = void 0; | ||
exports["default"] = void 0; | ||
@@ -103,2 +103,2 @@ var _batch = require("./batch"); | ||
exports.default = Subscription; | ||
exports["default"] = Subscription; |
@@ -6,3 +6,3 @@ "use strict"; | ||
exports.__esModule = true; | ||
exports.default = verifyPlainObject; | ||
exports["default"] = verifyPlainObject; | ||
@@ -14,5 +14,5 @@ var _isPlainObject = _interopRequireDefault(require("./isPlainObject")); | ||
function verifyPlainObject(value, displayName, methodName) { | ||
if (!(0, _isPlainObject.default)(value)) { | ||
(0, _warning.default)(methodName + "() in " + displayName + " must return a plain object. Instead received " + value + "."); | ||
if (!(0, _isPlainObject["default"])(value)) { | ||
(0, _warning["default"])(methodName + "() in " + displayName + " must return a plain object. Instead received " + value + "."); | ||
} | ||
} |
"use strict"; | ||
exports.__esModule = true; | ||
exports.default = warning; | ||
exports["default"] = warning; | ||
@@ -6,0 +6,0 @@ /** |
"use strict"; | ||
exports.__esModule = true; | ||
exports.default = wrapActionCreators; | ||
exports["default"] = wrapActionCreators; | ||
@@ -6,0 +6,0 @@ var _redux = require("redux"); |
@@ -0,0 +0,0 @@ The MIT License (MIT) |
{ | ||
"name": "react-redux", | ||
"version": "7.0.1", | ||
"version": "7.0.2", | ||
"description": "Official React bindings for Redux", | ||
@@ -35,3 +35,3 @@ "keywords": [ | ||
"pretest": "npm run lint", | ||
"test": "node ./test/run-tests.js", | ||
"test": "jest", | ||
"coverage": "codecov" | ||
@@ -66,3 +66,2 @@ }, | ||
"cross-env": "^5.2.0", | ||
"cross-spawn": "^6.0.5", | ||
"es3ify": "^0.2.0", | ||
@@ -77,3 +76,2 @@ "eslint": "^5.16.0", | ||
"jest-dom": "^3.1.3", | ||
"npm-run": "^5.0.1", | ||
"prettier": "^1.16.4", | ||
@@ -90,4 +88,3 @@ "react": "^16.8.6", | ||
"rollup-plugin-replace": "^2.1.1", | ||
"rollup-plugin-terser": "^4.0.4", | ||
"semver": "^6.0.0" | ||
"rollup-plugin-terser": "^4.0.4" | ||
}, | ||
@@ -98,3 +95,8 @@ "browserify": { | ||
] | ||
}, | ||
"jest": { | ||
"coverageDirectory": "./coverage/", | ||
"collectCoverage": true, | ||
"testURL": "http://localhost" | ||
} | ||
} |
@@ -0,0 +0,0 @@ React Redux |
@@ -0,0 +0,0 @@ import Provider from './components/Provider' |
@@ -294,3 +294,3 @@ import hoistStatics from 'hoist-non-react-statics' | ||
// Our re-subscribe logic only runs when the store/subscription setup changes | ||
useEffect(() => { | ||
useIsomorphicLayoutEffect(() => { | ||
// If we're not subscribed to the store, nothing to do here | ||
@@ -379,10 +379,10 @@ if (!shouldHandleStateChanges) return | ||
// We memoize the elements for the rendered child component as an optimization. | ||
const renderedWrappedComponent = useMemo( | ||
() => <WrappedComponent {...actualChildProps} ref={forwardedRef} />, | ||
[forwardedRef, WrappedComponent, actualChildProps] | ||
) | ||
// If React sees the exact same element reference as last time, it bails out of re-rendering | ||
// that child, same as if it was wrapped in React.memo() or returned false from shouldComponentUpdate. | ||
const renderedChild = useMemo(() => { | ||
// Render the actual child component | ||
const renderedWrappedComponent = ( | ||
<WrappedComponent {...actualChildProps} ref={forwardedRef} /> | ||
) | ||
if (shouldHandleStateChanges) { | ||
@@ -400,9 +400,3 @@ // If this component is subscribed to store updates, we need to pass its own | ||
return renderedWrappedComponent | ||
}, [ | ||
ContextToUse, | ||
WrappedComponent, | ||
actualChildProps, | ||
forwardedRef, | ||
overriddenContextValue | ||
]) | ||
}, [ContextToUse, renderedWrappedComponent, overriddenContextValue]) | ||
@@ -409,0 +403,0 @@ return renderedChild |
@@ -0,0 +0,0 @@ import React from 'react' |
@@ -0,0 +0,0 @@ import React, { Component } from 'react' |
@@ -0,0 +0,0 @@ import connectAdvanced from '../components/connectAdvanced' |
@@ -0,0 +0,0 @@ import { bindActionCreators } from 'redux' |
@@ -0,0 +0,0 @@ import { wrapMapToPropsConstant, wrapMapToPropsFunc } from './wrapMapToProps' |
@@ -0,0 +0,0 @@ import verifyPlainObject from '../utils/verifyPlainObject' |
@@ -0,0 +0,0 @@ import verifySubselectors from './verifySubselectors' |
@@ -0,0 +0,0 @@ import warning from '../utils/warning' |
@@ -0,0 +0,0 @@ import verifyPlainObject from '../utils/verifyPlainObject' |
@@ -0,0 +0,0 @@ import Provider from './components/Provider' |
@@ -0,0 +0,0 @@ // Default to a dummy "batch" implementation that just runs the callback |
/* eslint-disable import/no-unresolved */ | ||
export { unstable_batchedUpdates } from 'react-dom' |
@@ -0,0 +0,0 @@ /* eslint-disable import/no-unresolved */ |
@@ -0,0 +0,0 @@ const hasOwn = Object.prototype.hasOwnProperty |
@@ -0,0 +0,0 @@ import { getBatch } from './batch' |
@@ -0,0 +0,0 @@ import isPlainObject from './isPlainObject' |
@@ -0,0 +0,0 @@ /** |
@@ -0,0 +0,0 @@ import { bindActionCreators } from 'redux' |
Sorry, the diff of this file is too big to display
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
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
35
235810