react-redux
Advanced tools
Comparing version 8.1.2 to 8.1.3
@@ -1,2 +0,2 @@ | ||
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("react"),require("react-dom")):"function"==typeof define&&define.amd?define(["exports","react","react-dom"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).ReactRedux={},e.React,e.ReactDOM)}(this,(function(e,t,r){"use strict";function n(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}function o(e){if(e&&e.__esModule)return e;var t=Object.create(null);return e&&Object.keys(e).forEach((function(r){if("default"!==r){var n=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(t,r,n.get?n:{enumerable:!0,get:function(){return e[r]}})}})),t.default=e,Object.freeze(t)}var u=n(t),c=o(t);function s(e,t,r){return e(r={path:t,exports:{},require:function(e,t){return function(){throw Error("Dynamic requires are not currently supported by @rollup/plugin-commonjs")}()}},r.exports),r.exports}var a="function"==typeof Object.is?Object.is:function(e,t){return e===t&&(0!==e||1/e==1/t)||e!=e&&t!=t},i=u.default.useState,f=u.default.useEffect,l=u.default.useLayoutEffect,p=u.default.useDebugValue;function d(e){var t=e.getSnapshot;e=e.value;try{var r=t();return!a(e,r)}catch(e){return!0}}var y="undefined"==typeof window||void 0===window.document||void 0===window.document.createElement?function(e,t){return t()}:function(e,t){var r=t(),n=i({inst:{value:r,getSnapshot:t}}),o=n[0].inst,u=n[1];return l((function(){o.value=r,o.getSnapshot=t,d(o)&&u({inst:o})}),[e,r,t]),f((function(){return d(o)&&u({inst:o}),e((function(){d(o)&&u({inst:o})}))}),[e]),p(r),r},m={useSyncExternalStore:void 0!==u.default.useSyncExternalStore?u.default.useSyncExternalStore:y},b=s((function(e){e.exports=m}));var S="function"==typeof Object.is?Object.is:function(e,t){return e===t&&(0!==e||1/e==1/t)||e!=e&&t!=t},v=b.useSyncExternalStore,h=u.default.useRef,g=u.default.useEffect,P=u.default.useMemo,w=u.default.useDebugValue,x={useSyncExternalStoreWithSelector:function(e,t,r,n,o){var u=h(null);if(null===u.current){var c={hasValue:!1,value:null};u.current=c}else c=u.current;u=P((function(){function e(e){if(!a){if(a=!0,u=e,e=n(e),void 0!==o&&c.hasValue){var t=c.value;if(o(t,e))return s=t}return s=e}if(t=s,S(u,e))return t;var r=n(e);return void 0!==o&&o(t,r)?t:(u=e,s=r)}var u,s,a=!1,i=void 0===r?null:r;return[function(){return e(t())},null===i?void 0:function(){return e(i())}]}),[t,r,n,o]);var s=v(e,u[0],u[1]);return g((function(){c.hasValue=!0,c.value=s}),[s]),w(s),s}},O=s((function(e){e.exports=x}));let $=function(e){e()};const C=()=>$,M=Symbol.for("react-redux-context"),E="undefined"!=typeof globalThis?globalThis:{};function j(){var e;if(!c.createContext)return{};const t=null!=(e=E[M])?e:E[M]=new Map;let r=t.get(c.createContext);return r||(r=c.createContext(null),t.set(c.createContext,r)),r}const R=j();function T(e=R){return function(){return t.useContext(e)}}const q=T(),k=()=>{throw Error("uSES not initialized!")};let N=k;const D=(e,t)=>e===t;function F(e=R){const r=e===R?q:T(e);return function(e,n={}){const{equalityFn:o=D,stabilityCheck:u}="function"==typeof n?{equalityFn:n}:n,{store:c,subscription:s,getServerState:a,stabilityCheck:i}=r();t.useRef(!0);const f=t.useCallback({[e.name]:t=>e(t)}[e.name],[e,i,u]),l=N(s.addNestedSub,c.getState,a||c.getState,f,o);return t.useDebugValue(l),l}}const _=F();function L(){return(L=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 z(e,t){if(null==e)return{};var r,n,o={},u=Object.keys(e);for(n=0;u.length>n;n++)0>t.indexOf(r=u[n])&&(o[r]=e[r]);return o} | ||
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("react"),require("react-dom")):"function"==typeof define&&define.amd?define(["exports","react","react-dom"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).ReactRedux={},e.React,e.ReactDOM)}(this,(function(e,t,n){"use strict";function r(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}function o(e){if(e&&e.__esModule)return e;var t=Object.create(null);return e&&Object.keys(e).forEach((function(n){if("default"!==n){var r=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,r.get?r:{enumerable:!0,get:function(){return e[n]}})}})),t.default=e,Object.freeze(t)}var u=r(t),c=o(t);function s(e,t,n){return e(n={path:t,exports:{},require:function(e,t){return function(){throw Error("Dynamic requires are not currently supported by @rollup/plugin-commonjs")}()}},n.exports),n.exports}var a="function"==typeof Object.is?Object.is:function(e,t){return e===t&&(0!==e||1/e==1/t)||e!=e&&t!=t},i=u.default.useState,f=u.default.useEffect,l=u.default.useLayoutEffect,p=u.default.useDebugValue;function d(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!a(e,n)}catch(e){return!0}}var y="undefined"==typeof window||void 0===window.document||void 0===window.document.createElement?function(e,t){return t()}:function(e,t){var n=t(),r=i({inst:{value:n,getSnapshot:t}}),o=r[0].inst,u=r[1];return l((function(){o.value=n,o.getSnapshot=t,d(o)&&u({inst:o})}),[e,n,t]),f((function(){return d(o)&&u({inst:o}),e((function(){d(o)&&u({inst:o})}))}),[e]),p(n),n},m={useSyncExternalStore:void 0!==u.default.useSyncExternalStore?u.default.useSyncExternalStore:y},b=s((function(e){e.exports=m}));var S="function"==typeof Object.is?Object.is:function(e,t){return e===t&&(0!==e||1/e==1/t)||e!=e&&t!=t},v=b.useSyncExternalStore,h=u.default.useRef,g=u.default.useEffect,P=u.default.useMemo,w=u.default.useDebugValue,x={useSyncExternalStoreWithSelector:function(e,t,n,r,o){var u=h(null);if(null===u.current){var c={hasValue:!1,value:null};u.current=c}else c=u.current;u=P((function(){function e(e){if(!a){if(a=!0,u=e,e=r(e),void 0!==o&&c.hasValue){var t=c.value;if(o(t,e))return s=t}return s=e}if(t=s,S(u,e))return t;var n=r(e);return void 0!==o&&o(t,n)?t:(u=e,s=n)}var u,s,a=!1,i=void 0===n?null:n;return[function(){return e(t())},null===i?void 0:function(){return e(i())}]}),[t,n,r,o]);var s=v(e,u[0],u[1]);return g((function(){c.hasValue=!0,c.value=s}),[s]),w(s),s}},O=s((function(e){e.exports=x}));let $=function(e){e()};const C=()=>$,M=Symbol.for("react-redux-context"),E="undefined"!=typeof globalThis?globalThis:{};function j(){var e;if(!c.createContext)return{};const t=null!=(e=E[M])?e:E[M]=new Map;let n=t.get(c.createContext);return n||(n=c.createContext(null),t.set(c.createContext,n)),n}const R=j();function T(e=R){return function(){return t.useContext(e)}}const q=T(),k=()=>{throw Error("uSES not initialized!")};let N=k;const D=(e,t)=>e===t;function F(e=R){const n=e===R?q:T(e);return function(e,r={}){const{equalityFn:o=D,stabilityCheck:u}="function"==typeof r?{equalityFn:r}:r,{store:c,subscription:s,getServerState:a,stabilityCheck:i}=n();t.useRef(!0);const f=t.useCallback({[e.name]:t=>e(t)}[e.name],[e,i,u]),l=N(s.addNestedSub,c.getState,a||c.getState,f,o);return t.useDebugValue(l),l}}const _=F();function L(){return(L=Object.assign||function(e){for(var t=1;arguments.length>t;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function z(e,t){if(null==e)return{};var n,r,o={},u=Object.keys(e);for(r=0;u.length>r;r++)0>t.indexOf(n=u[r])&&(o[n]=e[n]);return o} | ||
/** @license React v16.13.1 | ||
@@ -9,3 +9,3 @@ * react-is.production.min.js | ||
* LICENSE file in the root directory of this source tree. | ||
*/var V="function"==typeof Symbol&&Symbol.for,W=V?Symbol.for("react.element"):60103,U=V?Symbol.for("react.portal"):60106,H=V?Symbol.for("react.fragment"):60107,A=V?Symbol.for("react.strict_mode"):60108,I=V?Symbol.for("react.profiler"):60114,B=V?Symbol.for("react.provider"):60109,G=V?Symbol.for("react.context"):60110,J=V?Symbol.for("react.async_mode"):60111,K=V?Symbol.for("react.concurrent_mode"):60111,Q=V?Symbol.for("react.forward_ref"):60112,X=V?Symbol.for("react.suspense"):60113,Y=V?Symbol.for("react.suspense_list"):60120,Z=V?Symbol.for("react.memo"):60115,ee=V?Symbol.for("react.lazy"):60116,te=V?Symbol.for("react.block"):60121,re=V?Symbol.for("react.fundamental"):60117,ne=V?Symbol.for("react.responder"):60118,oe=V?Symbol.for("react.scope"):60119;function ue(e){if("object"==typeof e&&null!==e){var t=e.$$typeof;switch(t){case W:switch(e=e.type){case J:case K:case H:case I:case A:case X:return e;default:switch(e=e&&e.$$typeof){case G:case Q:case ee:case Z:case B:return e;default:return t}}case U:return t}}}function ce(e){return ue(e)===K}var se={AsyncMode:J,ConcurrentMode:K,ContextConsumer:G,ContextProvider:B,Element:W,ForwardRef:Q,Fragment:H,Lazy:ee,Memo:Z,Portal:U,Profiler:I,StrictMode:A,Suspense:X,isAsyncMode:function(e){return ce(e)||ue(e)===J},isConcurrentMode:ce,isContextConsumer:function(e){return ue(e)===G},isContextProvider:function(e){return ue(e)===B},isElement:function(e){return"object"==typeof e&&null!==e&&e.$$typeof===W},isForwardRef:function(e){return ue(e)===Q},isFragment:function(e){return ue(e)===H},isLazy:function(e){return ue(e)===ee},isMemo:function(e){return ue(e)===Z},isPortal:function(e){return ue(e)===U},isProfiler:function(e){return ue(e)===I},isStrictMode:function(e){return ue(e)===A},isSuspense:function(e){return ue(e)===X},isValidElementType:function(e){return"string"==typeof e||"function"==typeof e||e===H||e===K||e===I||e===A||e===X||e===Y||"object"==typeof e&&null!==e&&(e.$$typeof===ee||e.$$typeof===Z||e.$$typeof===B||e.$$typeof===G||e.$$typeof===Q||e.$$typeof===re||e.$$typeof===ne||e.$$typeof===oe||e.$$typeof===te)},typeOf:ue},ae=s((function(e){e.exports=se})),ie={childContextTypes:!0,contextType:!0,contextTypes:!0,defaultProps:!0,displayName:!0,getDefaultProps:!0,getDerivedStateFromError:!0,getDerivedStateFromProps:!0,mixins:!0,propTypes:!0,type:!0},fe={name:!0,length:!0,prototype:!0,caller:!0,callee:!0,arguments:!0,arity:!0},le={$$typeof:!0,compare:!0,defaultProps:!0,displayName:!0,propTypes:!0,type:!0},pe={};function de(e){return ae.isMemo(e)?le:pe[e.$$typeof]||ie}pe[ae.ForwardRef]={$$typeof:!0,render:!0,defaultProps:!0,displayName:!0,propTypes:!0},pe[ae.Memo]=le;var ye=Object.defineProperty,me=Object.getOwnPropertyNames,be=Object.getOwnPropertySymbols,Se=Object.getOwnPropertyDescriptor,ve=Object.getPrototypeOf,he=Object.prototype;var ge=function e(t,r,n){if("string"!=typeof r){if(he){var o=ve(r);o&&o!==he&&e(t,o,n)}var u=me(r);be&&(u=u.concat(be(r)));for(var c=de(t),s=de(r),a=0;u.length>a;++a){var i=u[a];if(!(fe[i]||n&&n[i]||s&&s[i]||c&&c[i])){var f=Se(r,i);try{ye(t,i,f)}catch(e){}}}}return t},Pe=Symbol.for("react.element"),we=Symbol.for("react.portal"),xe=Symbol.for("react.fragment"),Oe=Symbol.for("react.strict_mode"),$e=Symbol.for("react.profiler"),Ce=Symbol.for("react.provider"),Me=Symbol.for("react.context"),Ee=Symbol.for("react.server_context"),je=Symbol.for("react.forward_ref"),Re=Symbol.for("react.suspense"),Te=Symbol.for("react.suspense_list"),qe=Symbol.for("react.memo"),ke=Symbol.for("react.lazy"),Ne=Symbol.for("react.offscreen"),De=Symbol.for("react.module.reference"); | ||
*/var V="function"==typeof Symbol&&Symbol.for,W=V?Symbol.for("react.element"):60103,U=V?Symbol.for("react.portal"):60106,H=V?Symbol.for("react.fragment"):60107,A=V?Symbol.for("react.strict_mode"):60108,I=V?Symbol.for("react.profiler"):60114,B=V?Symbol.for("react.provider"):60109,G=V?Symbol.for("react.context"):60110,J=V?Symbol.for("react.async_mode"):60111,K=V?Symbol.for("react.concurrent_mode"):60111,Q=V?Symbol.for("react.forward_ref"):60112,X=V?Symbol.for("react.suspense"):60113,Y=V?Symbol.for("react.suspense_list"):60120,Z=V?Symbol.for("react.memo"):60115,ee=V?Symbol.for("react.lazy"):60116,te=V?Symbol.for("react.block"):60121,ne=V?Symbol.for("react.fundamental"):60117,re=V?Symbol.for("react.responder"):60118,oe=V?Symbol.for("react.scope"):60119;function ue(e){if("object"==typeof e&&null!==e){var t=e.$$typeof;switch(t){case W:switch(e=e.type){case J:case K:case H:case I:case A:case X:return e;default:switch(e=e&&e.$$typeof){case G:case Q:case ee:case Z:case B:return e;default:return t}}case U:return t}}}function ce(e){return ue(e)===K}var se={AsyncMode:J,ConcurrentMode:K,ContextConsumer:G,ContextProvider:B,Element:W,ForwardRef:Q,Fragment:H,Lazy:ee,Memo:Z,Portal:U,Profiler:I,StrictMode:A,Suspense:X,isAsyncMode:function(e){return ce(e)||ue(e)===J},isConcurrentMode:ce,isContextConsumer:function(e){return ue(e)===G},isContextProvider:function(e){return ue(e)===B},isElement:function(e){return"object"==typeof e&&null!==e&&e.$$typeof===W},isForwardRef:function(e){return ue(e)===Q},isFragment:function(e){return ue(e)===H},isLazy:function(e){return ue(e)===ee},isMemo:function(e){return ue(e)===Z},isPortal:function(e){return ue(e)===U},isProfiler:function(e){return ue(e)===I},isStrictMode:function(e){return ue(e)===A},isSuspense:function(e){return ue(e)===X},isValidElementType:function(e){return"string"==typeof e||"function"==typeof e||e===H||e===K||e===I||e===A||e===X||e===Y||"object"==typeof e&&null!==e&&(e.$$typeof===ee||e.$$typeof===Z||e.$$typeof===B||e.$$typeof===G||e.$$typeof===Q||e.$$typeof===ne||e.$$typeof===re||e.$$typeof===oe||e.$$typeof===te)},typeOf:ue},ae=s((function(e){e.exports=se})),ie={childContextTypes:!0,contextType:!0,contextTypes:!0,defaultProps:!0,displayName:!0,getDefaultProps:!0,getDerivedStateFromError:!0,getDerivedStateFromProps:!0,mixins:!0,propTypes:!0,type:!0},fe={name:!0,length:!0,prototype:!0,caller:!0,callee:!0,arguments:!0,arity:!0},le={$$typeof:!0,compare:!0,defaultProps:!0,displayName:!0,propTypes:!0,type:!0},pe={};function de(e){return ae.isMemo(e)?le:pe[e.$$typeof]||ie}pe[ae.ForwardRef]={$$typeof:!0,render:!0,defaultProps:!0,displayName:!0,propTypes:!0},pe[ae.Memo]=le;var ye=Object.defineProperty,me=Object.getOwnPropertyNames,be=Object.getOwnPropertySymbols,Se=Object.getOwnPropertyDescriptor,ve=Object.getPrototypeOf,he=Object.prototype;var ge=function e(t,n,r){if("string"!=typeof n){if(he){var o=ve(n);o&&o!==he&&e(t,o,r)}var u=me(n);be&&(u=u.concat(be(n)));for(var c=de(t),s=de(n),a=0;u.length>a;++a){var i=u[a];if(!(fe[i]||r&&r[i]||s&&s[i]||c&&c[i])){var f=Se(n,i);try{ye(t,i,f)}catch(e){}}}}return t},Pe=Symbol.for("react.element"),we=Symbol.for("react.portal"),xe=Symbol.for("react.fragment"),Oe=Symbol.for("react.strict_mode"),$e=Symbol.for("react.profiler"),Ce=Symbol.for("react.provider"),Me=Symbol.for("react.context"),Ee=Symbol.for("react.server_context"),je=Symbol.for("react.forward_ref"),Re=Symbol.for("react.suspense"),Te=Symbol.for("react.suspense_list"),qe=Symbol.for("react.memo"),ke=Symbol.for("react.lazy"),Ne=Symbol.for("react.offscreen"),De=Symbol.for("react.module.reference"); | ||
/** | ||
@@ -19,2 +19,2 @@ * @license React | ||
* LICENSE file in the root directory of this source tree. | ||
*/function Fe(e){if("object"==typeof e&&null!==e){var t=e.$$typeof;switch(t){case Pe:switch(e=e.type){case xe:case $e:case Oe:case Re:case Te:return e;default:switch(e=e&&e.$$typeof){case Ee:case Me:case je:case ke:case qe:case Ce:return e;default:return t}}case we:return t}}}var _e={ContextConsumer:Me,ContextProvider:Ce,Element:Pe,ForwardRef:je,Fragment:xe,Lazy:ke,Memo:qe,Portal:we,Profiler:$e,StrictMode:Oe,Suspense:Re,SuspenseList:Te,isAsyncMode:function(){return!1},isConcurrentMode:function(){return!1},isContextConsumer:function(e){return Fe(e)===Me},isContextProvider:function(e){return Fe(e)===Ce},isElement:function(e){return"object"==typeof e&&null!==e&&e.$$typeof===Pe},isForwardRef:function(e){return Fe(e)===je},isFragment:function(e){return Fe(e)===xe},isLazy:function(e){return Fe(e)===ke},isMemo:function(e){return Fe(e)===qe},isPortal:function(e){return Fe(e)===we},isProfiler:function(e){return Fe(e)===$e},isStrictMode:function(e){return Fe(e)===Oe},isSuspense:function(e){return Fe(e)===Re},isSuspenseList:function(e){return Fe(e)===Te},isValidElementType:function(e){return"string"==typeof e||"function"==typeof e||e===xe||e===$e||e===Oe||e===Re||e===Te||e===Ne||"object"==typeof e&&null!==e&&(e.$$typeof===ke||e.$$typeof===qe||e.$$typeof===Ce||e.$$typeof===Me||e.$$typeof===je||e.$$typeof===De||void 0!==e.getModuleId)},typeOf:Fe},Le=s((function(e){e.exports=_e}));const ze=["initMapStateToProps","initMapDispatchToProps","initMergeProps"];function Ve(e,t,r,n,{areStatesEqual:o,areOwnPropsEqual:u,areStatePropsEqual:c}){let s,a,i,f,l,p=!1;function d(p,d){const y=!u(d,a),m=!o(p,s,d,a);return s=p,a=d,y&&m?(i=e(s,a),t.dependsOnOwnProps&&(f=t(n,a)),l=r(i,f,a),l):y?(e.dependsOnOwnProps&&(i=e(s,a)),t.dependsOnOwnProps&&(f=t(n,a)),l=r(i,f,a),l):m?function(){const t=e(s,a),n=!c(t,i);return i=t,n&&(l=r(i,f,a)),l}():l}return function(o,u){return p?d(o,u):(s=o,a=u,i=e(s,a),f=t(n,a),l=r(i,f,a),p=!0,l)}}function We(e){return function(t){const r=e(t);function n(){return r}return n.dependsOnOwnProps=!1,n}}function Ue(e){return e.dependsOnOwnProps?!!e.dependsOnOwnProps:1!==e.length}function He(e,t){return function(t,{}){const r=function(e,t){return r.mapToProps(e,r.dependsOnOwnProps?t:void 0)};return r.dependsOnOwnProps=!0,r.mapToProps=function(t,n){r.mapToProps=e,r.dependsOnOwnProps=Ue(e);let o=r(t,n);return"function"==typeof o&&(r.mapToProps=o,r.dependsOnOwnProps=Ue(o),o=r(t,n)),o},r}}function Ae(e,t){return(r,n)=>{throw Error(`Invalid value of type ${typeof e} for ${t} argument when connecting component ${n.wrappedComponentName}.`)}}function Ie(e,t,r){return L({},r,e,t)}const Be={notify(){},get:()=>[]};function Ge(e,t){let r,n=Be;function o(){c.onStateChange&&c.onStateChange()}function u(){r||(r=t?t.addNestedSub(o):e.subscribe(o),n=function(){const e=C();let t=null,r=null;return{clear(){t=null,r=null},notify(){e((()=>{let e=t;for(;e;)e.callback(),e=e.next}))},get(){let e=[],r=t;for(;r;)e.push(r),r=r.next;return e},subscribe(e){let n=!0,o=r={callback:e,next:null,prev:r};return o.prev?o.prev.next=o:t=o,function(){n&&null!==t&&(n=!1,o.next?o.next.prev=o.prev:r=o.prev,o.prev?o.prev.next=o.next:t=o.next)}}}}())}const c={addNestedSub:function(e){return u(),n.subscribe(e)},notifyNestedSubs:function(){n.notify()},handleChangeWrapper:o,isSubscribed:function(){return!!r},trySubscribe:u,tryUnsubscribe:function(){r&&(r(),r=void 0,n.clear(),n=Be)},getListeners:()=>n};return c}const Je=!("undefined"==typeof window||void 0===window.document||void 0===window.document.createElement)?c.useLayoutEffect:c.useEffect;function Ke(e,t){return e===t?0!==e||0!==t||1/e==1/t:e!=e&&t!=t}function Qe(e,t){if(Ke(e,t))return!0;if("object"!=typeof e||null===e||"object"!=typeof t||null===t)return!1;const r=Object.keys(e);if(r.length!==Object.keys(t).length)return!1;for(let n=0;r.length>n;n++)if(!Object.prototype.hasOwnProperty.call(t,r[n])||!Ke(e[r[n]],t[r[n]]))return!1;return!0}const Xe=["reactReduxForwardedRef"];let Ye=k;const Ze=[null,null];function et(e,t,r,n,o,u){e.current=n,r.current=!1,o.current&&(o.current=null,u())}function tt(e,t){return e===t}function rt(e=R){const t=e===R?q:T(e);return function(){const{store:e}=t();return e}}const nt=rt();function ot(e=R){const t=e===R?nt:rt(e);return function(){return t().dispatch}}const ut=ot();N=O.useSyncExternalStoreWithSelector,(e=>{Ye=e})(b.useSyncExternalStore),$=r.unstable_batchedUpdates,Object.defineProperty(e,"batch",{enumerable:!0,get:function(){return r.unstable_batchedUpdates}}),e.Provider=function({store:e,context:t,children:r,serverState:n,stabilityCheck:o="once",noopCheck:u="once"}){const s=c.useMemo((()=>{const t=Ge(e);return{store:e,subscription:t,getServerState:n?()=>n:void 0,stabilityCheck:o,noopCheck:u}}),[e,n,o,u]),a=c.useMemo((()=>e.getState()),[e]);return Je((()=>{const{subscription:t}=s;return t.onStateChange=t.notifyNestedSubs,t.trySubscribe(),a!==e.getState()&&t.notifyNestedSubs(),()=>{t.tryUnsubscribe(),t.onStateChange=void 0}}),[s,a]),c.createElement((t||R).Provider,{value:s},r)},e.ReactReduxContext=R,e.connect=function(e,t,r,{areStatesEqual:n=tt,areOwnPropsEqual:o=Qe,areStatePropsEqual:u=Qe,areMergedPropsEqual:s=Qe,forwardRef:a=!1,context:i=R}={}){const f=i,l=function(e){return e?"function"==typeof e?He(e):Ae(e,"mapStateToProps"):We((()=>({})))}(e),p=function(e){return e&&"object"==typeof e?We((t=>function(e,t){const r={};for(const n in e){const o=e[n];"function"==typeof o&&(r[n]=(...e)=>t(o(...e)))}return r}(e,t))):e?"function"==typeof e?He(e):Ae(e,"mapDispatchToProps"):We((e=>({dispatch:e})))}(t),d=function(e){return e?"function"==typeof e?function(e){return function(t,{areMergedPropsEqual:r}){let n,o=!1;return function(t,u,c){const s=e(t,u,c);return o?r(s,n)||(n=s):(o=!0,n=s),n}}}(e):Ae(e,"mergeProps"):()=>Ie}(r),y=!!e;return e=>{const t=e.displayName||e.name||"Component",r=`Connect(${t})`,i={shouldHandleStateChanges:y,displayName:r,wrappedComponentName:t,WrappedComponent:e,initMapStateToProps:l,initMapDispatchToProps:p,initMergeProps:d,areStatesEqual:n,areStatePropsEqual:u,areOwnPropsEqual:o,areMergedPropsEqual:s};function m(t){const[r,n,o]=c.useMemo((()=>{const{reactReduxForwardedRef:e}=t,r=z(t,Xe);return[t.context,e,r]}),[t]),u=c.useMemo((()=>r&&r.Consumer&&Le.isContextConsumer(c.createElement(r.Consumer,null))?r:f),[r,f]),s=c.useContext(u),a=!!t.store&&!!t.store.getState&&!!t.store.dispatch,l=a?t.store:s.store,p=!!s&&!!s.store?s.getServerState:l.getState,d=c.useMemo((()=>function(e,t){let{initMapStateToProps:r,initMapDispatchToProps:n,initMergeProps:o}=t,u=z(t,ze);return Ve(r(e,u),n(e,u),o(e,u),e,u)}(l.dispatch,i)),[l]),[m,b]=c.useMemo((()=>{if(!y)return Ze;const e=Ge(l,a?void 0:s.subscription),t=e.notifyNestedSubs.bind(e);return[e,t]}),[l,a,s]),S=c.useMemo((()=>a?s:L({},s,{subscription:m})),[a,s,m]),v=c.useRef(),h=c.useRef(o),g=c.useRef(),P=c.useRef(!1);c.useRef(!1);const w=c.useRef(!1),x=c.useRef();Je((()=>(w.current=!0,()=>{w.current=!1})),[]);const O=c.useMemo((()=>()=>g.current&&o===h.current?g.current:d(l.getState(),o)),[l,o]),$=c.useMemo((()=>e=>m?function(e,t,r,n,o,u,c,s,a,i,f){if(!e)return()=>{};let l=!1,p=null;const d=()=>{if(l||!s.current)return;const e=t.getState();let r,d;try{r=n(e,o.current)}catch(e){d=e,p=e}d||(p=null),r===u.current?c.current||i():(u.current=r,a.current=r,c.current=!0,f())};return r.onStateChange=d,r.trySubscribe(),d(),()=>{if(l=!0,r.tryUnsubscribe(),r.onStateChange=null,p)throw p}}(y,l,m,d,h,v,P,w,g,b,e):()=>{}),[m]);var C,M,E;let j;C=et,M=[h,v,P,o,g,b],Je((()=>C(...M)),E);try{j=Ye($,O,p?()=>d(p(),o):O)}catch(e){throw x.current&&(e.message+=`\nThe error may be correlated with this previous error:\n${x.current.stack}\n\n`),e}Je((()=>{x.current=void 0,g.current=void 0,v.current=j}));const R=c.useMemo((()=>c.createElement(e,L({},j,{ref:n}))),[n,e,j]);return c.useMemo((()=>y?c.createElement(u.Provider,{value:S},R):R),[u,R,S])}const b=c.memo(m);if(b.WrappedComponent=e,b.displayName=m.displayName=r,a){const t=c.forwardRef((function(e,t){return c.createElement(b,L({},e,{reactReduxForwardedRef:t}))}));return t.displayName=r,t.WrappedComponent=e,ge(t,e)}return ge(b,e)}},e.createDispatchHook=ot,e.createSelectorHook=F,e.createStoreHook=rt,e.shallowEqual=Qe,e.useDispatch=ut,e.useSelector=_,e.useStore=nt,Object.defineProperty(e,"__esModule",{value:!0})})); | ||
*/function Fe(e){if("object"==typeof e&&null!==e){var t=e.$$typeof;switch(t){case Pe:switch(e=e.type){case xe:case $e:case Oe:case Re:case Te:return e;default:switch(e=e&&e.$$typeof){case Ee:case Me:case je:case ke:case qe:case Ce:return e;default:return t}}case we:return t}}}var _e={ContextConsumer:Me,ContextProvider:Ce,Element:Pe,ForwardRef:je,Fragment:xe,Lazy:ke,Memo:qe,Portal:we,Profiler:$e,StrictMode:Oe,Suspense:Re,SuspenseList:Te,isAsyncMode:function(){return!1},isConcurrentMode:function(){return!1},isContextConsumer:function(e){return Fe(e)===Me},isContextProvider:function(e){return Fe(e)===Ce},isElement:function(e){return"object"==typeof e&&null!==e&&e.$$typeof===Pe},isForwardRef:function(e){return Fe(e)===je},isFragment:function(e){return Fe(e)===xe},isLazy:function(e){return Fe(e)===ke},isMemo:function(e){return Fe(e)===qe},isPortal:function(e){return Fe(e)===we},isProfiler:function(e){return Fe(e)===$e},isStrictMode:function(e){return Fe(e)===Oe},isSuspense:function(e){return Fe(e)===Re},isSuspenseList:function(e){return Fe(e)===Te},isValidElementType:function(e){return"string"==typeof e||"function"==typeof e||e===xe||e===$e||e===Oe||e===Re||e===Te||e===Ne||"object"==typeof e&&null!==e&&(e.$$typeof===ke||e.$$typeof===qe||e.$$typeof===Ce||e.$$typeof===Me||e.$$typeof===je||e.$$typeof===De||void 0!==e.getModuleId)},typeOf:Fe},Le=s((function(e){e.exports=_e}));const ze=["initMapStateToProps","initMapDispatchToProps","initMergeProps"];function Ve(e,t,n,r,{areStatesEqual:o,areOwnPropsEqual:u,areStatePropsEqual:c}){let s,a,i,f,l,p=!1;function d(p,d){const y=!u(d,a),m=!o(p,s,d,a);return s=p,a=d,y&&m?(i=e(s,a),t.dependsOnOwnProps&&(f=t(r,a)),l=n(i,f,a),l):y?(e.dependsOnOwnProps&&(i=e(s,a)),t.dependsOnOwnProps&&(f=t(r,a)),l=n(i,f,a),l):m?function(){const t=e(s,a),r=!c(t,i);return i=t,r&&(l=n(i,f,a)),l}():l}return function(o,u){return p?d(o,u):(s=o,a=u,i=e(s,a),f=t(r,a),l=n(i,f,a),p=!0,l)}}function We(e){return function(t){const n=e(t);function r(){return n}return r.dependsOnOwnProps=!1,r}}function Ue(e){return e.dependsOnOwnProps?!!e.dependsOnOwnProps:1!==e.length}function He(e,t){return function(t,{}){const n=function(e,t){return n.mapToProps(e,n.dependsOnOwnProps?t:void 0)};return n.dependsOnOwnProps=!0,n.mapToProps=function(t,r){n.mapToProps=e,n.dependsOnOwnProps=Ue(e);let o=n(t,r);return"function"==typeof o&&(n.mapToProps=o,n.dependsOnOwnProps=Ue(o),o=n(t,r)),o},n}}function Ae(e,t){return(n,r)=>{throw Error(`Invalid value of type ${typeof e} for ${t} argument when connecting component ${r.wrappedComponentName}.`)}}function Ie(e,t,n){return L({},n,e,t)}const Be={notify(){},get:()=>[]};function Ge(e,t){let n,r=Be,o=0,u=!1;function c(){i.onStateChange&&i.onStateChange()}function s(){o++,n||(n=t?t.addNestedSub(c):e.subscribe(c),r=function(){const e=C();let t=null,n=null;return{clear(){t=null,n=null},notify(){e((()=>{let e=t;for(;e;)e.callback(),e=e.next}))},get(){let e=[],n=t;for(;n;)e.push(n),n=n.next;return e},subscribe(e){let r=!0,o=n={callback:e,next:null,prev:n};return o.prev?o.prev.next=o:t=o,function(){r&&null!==t&&(r=!1,o.next?o.next.prev=o.prev:n=o.prev,o.prev?o.prev.next=o.next:t=o.next)}}}}())}function a(){o--,n&&0===o&&(n(),n=void 0,r.clear(),r=Be)}const i={addNestedSub:function(e){s();const t=r.subscribe(e);let n=!1;return()=>{n||(n=!0,t(),a())}},notifyNestedSubs:function(){r.notify()},handleChangeWrapper:c,isSubscribed:function(){return u},trySubscribe:function(){u||(u=!0,s())},tryUnsubscribe:function(){u&&(u=!1,a())},getListeners:()=>r};return i}const Je=!("undefined"==typeof window||void 0===window.document||void 0===window.document.createElement)?c.useLayoutEffect:c.useEffect;function Ke(e,t){return e===t?0!==e||0!==t||1/e==1/t:e!=e&&t!=t}function Qe(e,t){if(Ke(e,t))return!0;if("object"!=typeof e||null===e||"object"!=typeof t||null===t)return!1;const n=Object.keys(e);if(n.length!==Object.keys(t).length)return!1;for(let r=0;n.length>r;r++)if(!Object.prototype.hasOwnProperty.call(t,n[r])||!Ke(e[n[r]],t[n[r]]))return!1;return!0}const Xe=["reactReduxForwardedRef"];let Ye=k;const Ze=[null,null];function et(e,t,n,r,o,u){e.current=r,n.current=!1,o.current&&(o.current=null,u())}function tt(e,t){return e===t}function nt(e=R){const t=e===R?q:T(e);return function(){const{store:e}=t();return e}}const rt=nt();function ot(e=R){const t=e===R?rt:nt(e);return function(){return t().dispatch}}const ut=ot();N=O.useSyncExternalStoreWithSelector,(e=>{Ye=e})(b.useSyncExternalStore),$=n.unstable_batchedUpdates,Object.defineProperty(e,"batch",{enumerable:!0,get:function(){return n.unstable_batchedUpdates}}),e.Provider=function({store:e,context:t,children:n,serverState:r,stabilityCheck:o="once",noopCheck:u="once"}){const s=c.useMemo((()=>{const t=Ge(e);return{store:e,subscription:t,getServerState:r?()=>r:void 0,stabilityCheck:o,noopCheck:u}}),[e,r,o,u]),a=c.useMemo((()=>e.getState()),[e]);return Je((()=>{const{subscription:t}=s;return t.onStateChange=t.notifyNestedSubs,t.trySubscribe(),a!==e.getState()&&t.notifyNestedSubs(),()=>{t.tryUnsubscribe(),t.onStateChange=void 0}}),[s,a]),c.createElement((t||R).Provider,{value:s},n)},e.ReactReduxContext=R,e.connect=function(e,t,n,{areStatesEqual:r=tt,areOwnPropsEqual:o=Qe,areStatePropsEqual:u=Qe,areMergedPropsEqual:s=Qe,forwardRef:a=!1,context:i=R}={}){const f=i,l=function(e){return e?"function"==typeof e?He(e):Ae(e,"mapStateToProps"):We((()=>({})))}(e),p=function(e){return e&&"object"==typeof e?We((t=>function(e,t){const n={};for(const r in e){const o=e[r];"function"==typeof o&&(n[r]=(...e)=>t(o(...e)))}return n}(e,t))):e?"function"==typeof e?He(e):Ae(e,"mapDispatchToProps"):We((e=>({dispatch:e})))}(t),d=function(e){return e?"function"==typeof e?function(e){return function(t,{areMergedPropsEqual:n}){let r,o=!1;return function(t,u,c){const s=e(t,u,c);return o?n(s,r)||(r=s):(o=!0,r=s),r}}}(e):Ae(e,"mergeProps"):()=>Ie}(n),y=!!e;return e=>{const t=e.displayName||e.name||"Component",n=`Connect(${t})`,i={shouldHandleStateChanges:y,displayName:n,wrappedComponentName:t,WrappedComponent:e,initMapStateToProps:l,initMapDispatchToProps:p,initMergeProps:d,areStatesEqual:r,areStatePropsEqual:u,areOwnPropsEqual:o,areMergedPropsEqual:s};function m(t){const[n,r,o]=c.useMemo((()=>{const{reactReduxForwardedRef:e}=t,n=z(t,Xe);return[t.context,e,n]}),[t]),u=c.useMemo((()=>n&&n.Consumer&&Le.isContextConsumer(c.createElement(n.Consumer,null))?n:f),[n,f]),s=c.useContext(u),a=!!t.store&&!!t.store.getState&&!!t.store.dispatch,l=a?t.store:s.store,p=!!s&&!!s.store?s.getServerState:l.getState,d=c.useMemo((()=>function(e,t){let{initMapStateToProps:n,initMapDispatchToProps:r,initMergeProps:o}=t,u=z(t,ze);return Ve(n(e,u),r(e,u),o(e,u),e,u)}(l.dispatch,i)),[l]),[m,b]=c.useMemo((()=>{if(!y)return Ze;const e=Ge(l,a?void 0:s.subscription),t=e.notifyNestedSubs.bind(e);return[e,t]}),[l,a,s]),S=c.useMemo((()=>a?s:L({},s,{subscription:m})),[a,s,m]),v=c.useRef(),h=c.useRef(o),g=c.useRef(),P=c.useRef(!1);c.useRef(!1);const w=c.useRef(!1),x=c.useRef();Je((()=>(w.current=!0,()=>{w.current=!1})),[]);const O=c.useMemo((()=>()=>g.current&&o===h.current?g.current:d(l.getState(),o)),[l,o]),$=c.useMemo((()=>e=>m?function(e,t,n,r,o,u,c,s,a,i,f){if(!e)return()=>{};let l=!1,p=null;const d=()=>{if(l||!s.current)return;const e=t.getState();let n,d;try{n=r(e,o.current)}catch(e){d=e,p=e}d||(p=null),n===u.current?c.current||i():(u.current=n,a.current=n,c.current=!0,f())};return n.onStateChange=d,n.trySubscribe(),d(),()=>{if(l=!0,n.tryUnsubscribe(),n.onStateChange=null,p)throw p}}(y,l,m,d,h,v,P,w,g,b,e):()=>{}),[m]);var C,M,E;let j;C=et,M=[h,v,P,o,g,b],Je((()=>C(...M)),E);try{j=Ye($,O,p?()=>d(p(),o):O)}catch(e){throw x.current&&(e.message+=`\nThe error may be correlated with this previous error:\n${x.current.stack}\n\n`),e}Je((()=>{x.current=void 0,g.current=void 0,v.current=j}));const R=c.useMemo((()=>c.createElement(e,L({},j,{ref:r}))),[r,e,j]);return c.useMemo((()=>y?c.createElement(u.Provider,{value:S},R):R),[u,R,S])}const b=c.memo(m);if(b.WrappedComponent=e,b.displayName=m.displayName=n,a){const t=c.forwardRef((function(e,t){return c.createElement(b,L({},e,{reactReduxForwardedRef:t}))}));return t.displayName=n,t.WrappedComponent=e,ge(t,e)}return ge(b,e)}},e.createDispatchHook=ot,e.createSelectorHook=F,e.createStoreHook=nt,e.shallowEqual=Qe,e.useDispatch=ut,e.useSelector=_,e.useStore=rt,Object.defineProperty(e,"__esModule",{value:!0})})); |
declare const batch: (callback: () => void) => void; | ||
export { batch }; | ||
export * from './exports'; |
@@ -0,0 +0,0 @@ import type { Store } from 'redux'; |
@@ -0,0 +0,0 @@ import _extends from "@babel/runtime/helpers/esm/extends"; |
@@ -0,0 +0,0 @@ import * as React from 'react'; |
@@ -0,0 +0,0 @@ import type { Context, ReactNode } from 'react'; |
@@ -0,0 +0,0 @@ import type { Action, Dispatch } from 'redux'; |
@@ -0,0 +0,0 @@ import type { Action, Dispatch } from 'redux'; |
@@ -0,0 +0,0 @@ import type { MapStateToPropsParam } from './selectorFactory'; |
@@ -0,0 +0,0 @@ import type { Action, Dispatch } from 'redux'; |
@@ -0,0 +0,0 @@ import type { Dispatch, Action } from 'redux'; |
export default function verifySubselectors(mapStateToProps: unknown, mapDispatchToProps: unknown, mergeProps: unknown): void; |
@@ -0,0 +0,0 @@ import type { ActionCreatorsMapObject, Dispatch, ActionCreator } from 'redux'; |
@@ -0,0 +0,0 @@ import Provider from './components/Provider'; |
@@ -0,0 +0,0 @@ import type { Action, AnyAction, Dispatch } from 'redux'; |
@@ -0,0 +0,0 @@ import { ReactReduxContext } from '../components/Context'; |
@@ -0,0 +0,0 @@ /// <reference types="react" /> |
@@ -0,0 +0,0 @@ import { useContext } from 'react'; |
@@ -0,0 +0,0 @@ /// <reference types="react" /> |
@@ -63,6 +63,18 @@ import { useCallback, useDebugValue, useRef } from 'react'; | ||
if (!equalityFn(selected, toCompare)) { | ||
let stack = undefined; | ||
try { | ||
throw new Error(); | ||
} catch (e) { | ||
; | ||
({ | ||
stack | ||
} = e); | ||
} | ||
console.warn('Selector ' + (selector.name || 'unknown') + ' returned a different result when called with the same parameters. This can lead to unnecessary rerenders.' + '\nSelectors that return a new reference (such as an object or an array) should be memoized: https://redux.js.org/usage/deriving-data-selectors#optimizing-selectors-with-memoization', { | ||
state, | ||
selected, | ||
selected2: toCompare | ||
selected2: toCompare, | ||
stack | ||
}); | ||
@@ -77,3 +89,16 @@ } | ||
if (selected === state) { | ||
console.warn('Selector ' + (selector.name || 'unknown') + ' returned the root state when called. This can lead to unnecessary rerenders.' + '\nSelectors that return the entire state are almost certainly a mistake, as they will cause a rerender whenever *anything* in state changes.'); | ||
let stack = undefined; | ||
try { | ||
throw new Error(); | ||
} catch (e) { | ||
; | ||
({ | ||
stack | ||
} = e); | ||
} | ||
console.warn('Selector ' + (selector.name || 'unknown') + ' returned the root state when called. This can lead to unnecessary rerenders.' + '\nSelectors that return the entire state are almost certainly a mistake, as they will cause a rerender whenever *anything* in state changes.', { | ||
stack | ||
}); | ||
} | ||
@@ -80,0 +105,0 @@ } |
@@ -0,0 +0,0 @@ import type { Context } from 'react'; |
@@ -0,0 +0,0 @@ import { ReactReduxContext } from '../components/Context'; |
import { unstable_batchedUpdates as batch } from './utils/reactBatchedUpdates'; | ||
export { batch }; | ||
export * from './exports'; |
import { unstable_batchedUpdates as batch } from './utils/reactBatchedUpdates'; | ||
export { batch }; | ||
export * from './exports'; |
@@ -0,0 +0,0 @@ import type { ClassAttributes, ComponentClass, ComponentType, FunctionComponent } from 'react'; |
@@ -0,0 +0,0 @@ declare function defaultNoopBatch(callback: () => void): void; |
import type { ActionCreatorsMapObject, Dispatch } from 'redux'; | ||
export default function bindActionCreators(actionCreators: ActionCreatorsMapObject, dispatch: Dispatch): ActionCreatorsMapObject; |
@@ -0,0 +0,0 @@ /** |
@@ -0,0 +0,0 @@ /** |
export { unstable_batchedUpdates } from 'react-dom'; |
import { unstable_batchedUpdates } from 'react-native'; | ||
export { unstable_batchedUpdates }; |
export default function shallowEqual(objA: any, objB: any): boolean; |
@@ -0,0 +0,0 @@ declare type VoidFunc = () => void; |
@@ -80,7 +80,20 @@ import { getBatch } from './batch'; // encapsulates the subscription logic for connecting a component to the redux store, as | ||
let unsubscribe; | ||
let listeners = nullListeners; | ||
let listeners = nullListeners; // Reasons to keep the subscription active | ||
let subscriptionsAmount = 0; // Is this specific subscription subscribed (or only nested ones?) | ||
let selfSubscribed = false; | ||
function addNestedSub(listener) { | ||
trySubscribe(); | ||
return listeners.subscribe(listener); | ||
const cleanupListener = listeners.subscribe(listener); // cleanup nested sub | ||
let removed = false; | ||
return () => { | ||
if (!removed) { | ||
removed = true; | ||
cleanupListener(); | ||
tryUnsubscribe(); | ||
} | ||
}; | ||
} | ||
@@ -99,6 +112,8 @@ | ||
function isSubscribed() { | ||
return Boolean(unsubscribe); | ||
return selfSubscribed; | ||
} | ||
function trySubscribe() { | ||
subscriptionsAmount++; | ||
if (!unsubscribe) { | ||
@@ -111,3 +126,5 @@ unsubscribe = parentSub ? parentSub.addNestedSub(handleChangeWrapper) : store.subscribe(handleChangeWrapper); | ||
function tryUnsubscribe() { | ||
if (unsubscribe) { | ||
subscriptionsAmount--; | ||
if (unsubscribe && subscriptionsAmount === 0) { | ||
unsubscribe(); | ||
@@ -120,2 +137,16 @@ unsubscribe = undefined; | ||
function trySubscribeSelf() { | ||
if (!selfSubscribed) { | ||
selfSubscribed = true; | ||
trySubscribe(); | ||
} | ||
} | ||
function tryUnsubscribeSelf() { | ||
if (selfSubscribed) { | ||
selfSubscribed = false; | ||
tryUnsubscribe(); | ||
} | ||
} | ||
const subscription = { | ||
@@ -126,4 +157,4 @@ addNestedSub, | ||
isSubscribed, | ||
trySubscribe, | ||
tryUnsubscribe, | ||
trySubscribe: trySubscribeSelf, | ||
tryUnsubscribe: tryUnsubscribeSelf, | ||
getListeners: () => listeners | ||
@@ -130,0 +161,0 @@ }; |
import * as React from 'react'; | ||
export declare const canUseDOM: boolean; | ||
export declare const useIsomorphicLayoutEffect: typeof React.useLayoutEffect; |
import * as React from 'react'; | ||
export declare const useIsomorphicLayoutEffect: typeof React.useLayoutEffect; |
@@ -0,0 +0,0 @@ import type { useSyncExternalStore } from 'use-sync-external-store'; |
export default function verifyPlainObject(value: unknown, displayName: string, methodName: string): void; |
@@ -0,0 +0,0 @@ /** |
@@ -0,0 +0,0 @@ /** |
@@ -0,0 +0,0 @@ "use strict"; |
@@ -0,0 +0,0 @@ "use strict"; |
@@ -0,0 +0,0 @@ "use strict"; |
@@ -76,6 +76,18 @@ "use strict"; | ||
if (!equalityFn(selected, toCompare)) { | ||
let stack = undefined; | ||
try { | ||
throw new Error(); | ||
} catch (e) { | ||
; | ||
({ | ||
stack | ||
} = e); | ||
} | ||
console.warn('Selector ' + (selector.name || 'unknown') + ' returned a different result when called with the same parameters. This can lead to unnecessary rerenders.' + '\nSelectors that return a new reference (such as an object or an array) should be memoized: https://redux.js.org/usage/deriving-data-selectors#optimizing-selectors-with-memoization', { | ||
state, | ||
selected, | ||
selected2: toCompare | ||
selected2: toCompare, | ||
stack | ||
}); | ||
@@ -90,3 +102,16 @@ } | ||
if (selected === state) { | ||
console.warn('Selector ' + (selector.name || 'unknown') + ' returned the root state when called. This can lead to unnecessary rerenders.' + '\nSelectors that return the entire state are almost certainly a mistake, as they will cause a rerender whenever *anything* in state changes.'); | ||
let stack = undefined; | ||
try { | ||
throw new Error(); | ||
} catch (e) { | ||
; | ||
({ | ||
stack | ||
} = e); | ||
} | ||
console.warn('Selector ' + (selector.name || 'unknown') + ' returned the root state when called. This can lead to unnecessary rerenders.' + '\nSelectors that return the entire state are almost certainly a mistake, as they will cause a rerender whenever *anything* in state changes.', { | ||
stack | ||
}); | ||
} | ||
@@ -93,0 +118,0 @@ } |
@@ -0,0 +0,0 @@ "use strict"; |
@@ -0,0 +0,0 @@ "use strict"; |
@@ -84,7 +84,20 @@ "use strict"; | ||
let unsubscribe; | ||
let listeners = nullListeners; | ||
let listeners = nullListeners; // Reasons to keep the subscription active | ||
let subscriptionsAmount = 0; // Is this specific subscription subscribed (or only nested ones?) | ||
let selfSubscribed = false; | ||
function addNestedSub(listener) { | ||
trySubscribe(); | ||
return listeners.subscribe(listener); | ||
const cleanupListener = listeners.subscribe(listener); // cleanup nested sub | ||
let removed = false; | ||
return () => { | ||
if (!removed) { | ||
removed = true; | ||
cleanupListener(); | ||
tryUnsubscribe(); | ||
} | ||
}; | ||
} | ||
@@ -103,6 +116,8 @@ | ||
function isSubscribed() { | ||
return Boolean(unsubscribe); | ||
return selfSubscribed; | ||
} | ||
function trySubscribe() { | ||
subscriptionsAmount++; | ||
if (!unsubscribe) { | ||
@@ -115,3 +130,5 @@ unsubscribe = parentSub ? parentSub.addNestedSub(handleChangeWrapper) : store.subscribe(handleChangeWrapper); | ||
function tryUnsubscribe() { | ||
if (unsubscribe) { | ||
subscriptionsAmount--; | ||
if (unsubscribe && subscriptionsAmount === 0) { | ||
unsubscribe(); | ||
@@ -124,2 +141,16 @@ unsubscribe = undefined; | ||
function trySubscribeSelf() { | ||
if (!selfSubscribed) { | ||
selfSubscribed = true; | ||
trySubscribe(); | ||
} | ||
} | ||
function tryUnsubscribeSelf() { | ||
if (selfSubscribed) { | ||
selfSubscribed = false; | ||
tryUnsubscribe(); | ||
} | ||
} | ||
const subscription = { | ||
@@ -130,4 +161,4 @@ addNestedSub, | ||
isSubscribed, | ||
trySubscribe, | ||
tryUnsubscribe, | ||
trySubscribe: trySubscribeSelf, | ||
tryUnsubscribe: tryUnsubscribeSelf, | ||
getListeners: () => listeners | ||
@@ -134,0 +165,0 @@ }; |
@@ -0,0 +0,0 @@ "use strict"; |
@@ -0,0 +0,0 @@ The MIT License (MIT) |
{ | ||
"name": "react-redux", | ||
"version": "8.1.2", | ||
"version": "8.1.3", | ||
"description": "Official React bindings for Redux", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
@@ -0,0 +0,0 @@ # React Redux |
@@ -0,0 +0,0 @@ // The "alternate renderers" entry point is primarily here to fall back on a no-op |
@@ -0,0 +0,0 @@ import * as React from 'react' |
@@ -0,0 +0,0 @@ import type { Action, Dispatch } from 'redux' |
@@ -0,0 +0,0 @@ import type { Action, Dispatch } from 'redux' |
@@ -0,0 +0,0 @@ import { wrapMapToPropsConstant, wrapMapToPropsFunc } from './wrapMapToProps' |
@@ -0,0 +0,0 @@ import type { Action, Dispatch } from 'redux' |
@@ -0,0 +0,0 @@ import type { Dispatch, Action } from 'redux' |
@@ -0,0 +0,0 @@ import warning from '../utils/warning' |
@@ -0,0 +0,0 @@ import type { ActionCreatorsMapObject, Dispatch, ActionCreator } from 'redux' |
@@ -0,0 +0,0 @@ import Provider from './components/Provider' |
@@ -0,0 +0,0 @@ import type { Action, AnyAction, Dispatch } from 'redux' |
@@ -0,0 +0,0 @@ import { useContext } from 'react' |
@@ -102,2 +102,8 @@ import { useCallback, useDebugValue, useRef } from 'react' | ||
if (!equalityFn(selected, toCompare)) { | ||
let stack: string | undefined = undefined | ||
try { | ||
throw new Error() | ||
} catch (e) { | ||
;({ stack } = e as Error) | ||
} | ||
console.warn( | ||
@@ -112,2 +118,3 @@ 'Selector ' + | ||
selected2: toCompare, | ||
stack, | ||
} | ||
@@ -125,2 +132,8 @@ ) | ||
if (selected === state) { | ||
let stack: string | undefined = undefined | ||
try { | ||
throw new Error() | ||
} catch (e) { | ||
;({ stack } = e as Error) | ||
} | ||
console.warn( | ||
@@ -130,3 +143,4 @@ 'Selector ' + | ||
' returned the root state when called. This can lead to unnecessary rerenders.' + | ||
'\nSelectors that return the entire state are almost certainly a mistake, as they will cause a rerender whenever *anything* in state changes.' | ||
'\nSelectors that return the entire state are almost certainly a mistake, as they will cause a rerender whenever *anything* in state changes.', | ||
{ stack } | ||
) | ||
@@ -133,0 +147,0 @@ } |
@@ -0,0 +0,0 @@ import type { Context } from 'react' |
@@ -0,0 +0,0 @@ // The primary entry point assumes we're working with standard ReactDOM/RN, but |
@@ -0,0 +0,0 @@ // The secondary entry point assumes we are working with React 18, and thus have |
@@ -0,0 +0,0 @@ import type { |
@@ -0,0 +0,0 @@ // Default to a dummy "batch" implementation that just runs the callback |
@@ -0,0 +0,0 @@ import type { ActionCreatorsMapObject, Dispatch } from 'redux' |
@@ -0,0 +0,0 @@ /** |
@@ -0,0 +0,0 @@ /* eslint-disable import/namespace */ |
export { unstable_batchedUpdates } from 'react-dom' |
@@ -0,0 +0,0 @@ function is(x: unknown, y: unknown) { |
@@ -102,5 +102,22 @@ import { getBatch } from './batch' | ||
// Reasons to keep the subscription active | ||
let subscriptionsAmount = 0 | ||
// Is this specific subscription subscribed (or only nested ones?) | ||
let selfSubscribed = false | ||
function addNestedSub(listener: () => void) { | ||
trySubscribe() | ||
return listeners.subscribe(listener) | ||
const cleanupListener = listeners.subscribe(listener) | ||
// cleanup nested sub | ||
let removed = false | ||
return () => { | ||
if (!removed) { | ||
removed = true | ||
cleanupListener() | ||
tryUnsubscribe() | ||
} | ||
} | ||
} | ||
@@ -119,6 +136,7 @@ | ||
function isSubscribed() { | ||
return Boolean(unsubscribe) | ||
return selfSubscribed | ||
} | ||
function trySubscribe() { | ||
subscriptionsAmount++ | ||
if (!unsubscribe) { | ||
@@ -134,3 +152,4 @@ unsubscribe = parentSub | ||
function tryUnsubscribe() { | ||
if (unsubscribe) { | ||
subscriptionsAmount-- | ||
if (unsubscribe && subscriptionsAmount === 0) { | ||
unsubscribe() | ||
@@ -143,2 +162,16 @@ unsubscribe = undefined | ||
function trySubscribeSelf() { | ||
if (!selfSubscribed) { | ||
selfSubscribed = true | ||
trySubscribe() | ||
} | ||
} | ||
function tryUnsubscribeSelf() { | ||
if (selfSubscribed) { | ||
selfSubscribed = false | ||
tryUnsubscribe() | ||
} | ||
} | ||
const subscription: Subscription = { | ||
@@ -149,4 +182,4 @@ addNestedSub, | ||
isSubscribed, | ||
trySubscribe, | ||
tryUnsubscribe, | ||
trySubscribe: trySubscribeSelf, | ||
tryUnsubscribe: tryUnsubscribeSelf, | ||
getListeners: () => listeners, | ||
@@ -153,0 +186,0 @@ } |
@@ -0,0 +0,0 @@ import * as React from 'react' |
@@ -0,0 +0,0 @@ import * as React from 'react' |
@@ -0,0 +0,0 @@ import type { useSyncExternalStore } from 'use-sync-external-store' |
@@ -0,0 +0,0 @@ import isPlainObject from './isPlainObject' |
@@ -0,0 +0,0 @@ /** |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
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
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
342566
7122
0