react-redux
Advanced tools
Comparing version 8.0.7 to 8.1.0
@@ -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}}var o=n(t);function u(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 c="function"==typeof Object.is?Object.is:function(e,t){return e===t&&(0!==e||1/e==1/t)||e!=e&&t!=t},s=o.default.useState,a=o.default.useEffect,i=o.default.useLayoutEffect,f=o.default.useDebugValue;function l(e){var t=e.getSnapshot;e=e.value;try{var r=t();return!c(e,r)}catch(e){return!0}}var p="undefined"==typeof window||void 0===window.document||void 0===window.document.createElement?function(e,t){return t()}:function(e,t){var r=t(),n=s({inst:{value:r,getSnapshot:t}}),o=n[0].inst,u=n[1];return i((function(){o.value=r,o.getSnapshot=t,l(o)&&u({inst:o})}),[e,r,t]),a((function(){return l(o)&&u({inst:o}),e((function(){l(o)&&u({inst:o})}))}),[e]),f(r),r},d={useSyncExternalStore:void 0!==o.default.useSyncExternalStore?o.default.useSyncExternalStore:p},y=u((function(e){e.exports=d}));var m="function"==typeof Object.is?Object.is:function(e,t){return e===t&&(0!==e||1/e==1/t)||e!=e&&t!=t},S=y.useSyncExternalStore,b=o.default.useRef,v=o.default.useEffect,g=o.default.useMemo,h=o.default.useDebugValue,P={useSyncExternalStoreWithSelector:function(e,t,r,n,o){var u=b(null);if(null===u.current){var c={hasValue:!1,value:null};u.current=c}else c=u.current;u=g((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,m(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=S(e,u[0],u[1]);return v((function(){c.hasValue=!0,c.value=s}),[s]),h(s),s}},w=u((function(e){e.exports=P}));let x=function(e){e()};const $=()=>x,O=t.createContext(null);function E(){return t.useContext(O)}const M=()=>{throw Error("uSES not initialized!")};let C=M;const j=(e,t)=>e===t;function R(e=O){const r=e===O?E:()=>t.useContext(e);return function(e,n=j){const{store:o,subscription:u,getServerState:c}=r(),s=C(u.addNestedSub,o.getState,c||o.getState,e,n);return t.useDebugValue(s),s}}const T=R();function N(){return(N=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 q(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}}var o=r(t);function u(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 c="function"==typeof Object.is?Object.is:function(e,t){return e===t&&(0!==e||1/e==1/t)||e!=e&&t!=t},s=o.default.useState,a=o.default.useEffect,i=o.default.useLayoutEffect,f=o.default.useDebugValue;function l(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!c(e,n)}catch(e){return!0}}var p="undefined"==typeof window||void 0===window.document||void 0===window.document.createElement?function(e,t){return t()}:function(e,t){var n=t(),r=s({inst:{value:n,getSnapshot:t}}),o=r[0].inst,u=r[1];return i((function(){o.value=n,o.getSnapshot=t,l(o)&&u({inst:o})}),[e,n,t]),a((function(){return l(o)&&u({inst:o}),e((function(){l(o)&&u({inst:o})}))}),[e]),f(n),n},d={useSyncExternalStore:void 0!==o.default.useSyncExternalStore?o.default.useSyncExternalStore:p},y=u((function(e){e.exports=d}));var m="function"==typeof Object.is?Object.is:function(e,t){return e===t&&(0!==e||1/e==1/t)||e!=e&&t!=t},b=y.useSyncExternalStore,S=o.default.useRef,v=o.default.useEffect,h=o.default.useMemo,g=o.default.useDebugValue,P={useSyncExternalStoreWithSelector:function(e,t,n,r,o){var u=S(null);if(null===u.current){var c={hasValue:!1,value:null};u.current=c}else c=u.current;u=h((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,m(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=b(e,u[0],u[1]);return v((function(){c.hasValue=!0,c.value=s}),[s]),g(s),s}},w=u((function(e){e.exports=P}));let x=function(e){e()};const $=()=>x;let O=null;const C=new Proxy({},new Proxy({},{get(e,n){const r=(O||(O=t.createContext(null)),O);return(e,...t)=>Reflect[n](r,...t)}}));function E(e=C){return function(){return t.useContext(e)}}const M=E(),j=()=>{throw Error("uSES not initialized!")};let R=j;const T=(e,t)=>e===t;function q(e=C){const n=e===C?M:E(e);return function(e,r={}){const{equalityFn:o=T,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=R(s.addNestedSub,c.getState,a||c.getState,f,o);return t.useDebugValue(l),l}}const N=q();function k(){return(k=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 F(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 D="function"==typeof Symbol&&Symbol.for,F=D?Symbol.for("react.element"):60103,_=D?Symbol.for("react.portal"):60106,k=D?Symbol.for("react.fragment"):60107,L=D?Symbol.for("react.strict_mode"):60108,V=D?Symbol.for("react.profiler"):60114,z=D?Symbol.for("react.provider"):60109,W=D?Symbol.for("react.context"):60110,U=D?Symbol.for("react.async_mode"):60111,H=D?Symbol.for("react.concurrent_mode"):60111,A=D?Symbol.for("react.forward_ref"):60112,I=D?Symbol.for("react.suspense"):60113,B=D?Symbol.for("react.suspense_list"):60120,G=D?Symbol.for("react.memo"):60115,J=D?Symbol.for("react.lazy"):60116,K=D?Symbol.for("react.block"):60121,Q=D?Symbol.for("react.fundamental"):60117,X=D?Symbol.for("react.responder"):60118,Y=D?Symbol.for("react.scope"):60119;function Z(e){if("object"==typeof e&&null!==e){var t=e.$$typeof;switch(t){case F:switch(e=e.type){case U:case H:case k:case V:case L:case I:return e;default:switch(e=e&&e.$$typeof){case W:case A:case J:case G:case z:return e;default:return t}}case _:return t}}}function ee(e){return Z(e)===H}var te={AsyncMode:U,ConcurrentMode:H,ContextConsumer:W,ContextProvider:z,Element:F,ForwardRef:A,Fragment:k,Lazy:J,Memo:G,Portal:_,Profiler:V,StrictMode:L,Suspense:I,isAsyncMode:function(e){return ee(e)||Z(e)===U},isConcurrentMode:ee,isContextConsumer:function(e){return Z(e)===W},isContextProvider:function(e){return Z(e)===z},isElement:function(e){return"object"==typeof e&&null!==e&&e.$$typeof===F},isForwardRef:function(e){return Z(e)===A},isFragment:function(e){return Z(e)===k},isLazy:function(e){return Z(e)===J},isMemo:function(e){return Z(e)===G},isPortal:function(e){return Z(e)===_},isProfiler:function(e){return Z(e)===V},isStrictMode:function(e){return Z(e)===L},isSuspense:function(e){return Z(e)===I},isValidElementType:function(e){return"string"==typeof e||"function"==typeof e||e===k||e===H||e===V||e===L||e===I||e===B||"object"==typeof e&&null!==e&&(e.$$typeof===J||e.$$typeof===G||e.$$typeof===z||e.$$typeof===W||e.$$typeof===A||e.$$typeof===Q||e.$$typeof===X||e.$$typeof===Y||e.$$typeof===K)},typeOf:Z},re=u((function(e){e.exports=te})),ne={childContextTypes:!0,contextType:!0,contextTypes:!0,defaultProps:!0,displayName:!0,getDefaultProps:!0,getDerivedStateFromError:!0,getDerivedStateFromProps:!0,mixins:!0,propTypes:!0,type:!0},oe={name:!0,length:!0,prototype:!0,caller:!0,callee:!0,arguments:!0,arity:!0},ue={$$typeof:!0,compare:!0,defaultProps:!0,displayName:!0,propTypes:!0,type:!0},ce={};function se(e){return re.isMemo(e)?ue:ce[e.$$typeof]||ne}ce[re.ForwardRef]={$$typeof:!0,render:!0,defaultProps:!0,displayName:!0,propTypes:!0},ce[re.Memo]=ue;var ae=Object.defineProperty,ie=Object.getOwnPropertyNames,fe=Object.getOwnPropertySymbols,le=Object.getOwnPropertyDescriptor,pe=Object.getPrototypeOf,de=Object.prototype;var ye=function e(t,r,n){if("string"!=typeof r){if(de){var o=pe(r);o&&o!==de&&e(t,o,n)}var u=ie(r);fe&&(u=u.concat(fe(r)));for(var c=se(t),s=se(r),a=0;u.length>a;++a){var i=u[a];if(!(oe[i]||n&&n[i]||s&&s[i]||c&&c[i])){var f=le(r,i);try{ae(t,i,f)}catch(e){}}}}return t},me=Symbol.for("react.element"),Se=Symbol.for("react.portal"),be=Symbol.for("react.fragment"),ve=Symbol.for("react.strict_mode"),ge=Symbol.for("react.profiler"),he=Symbol.for("react.provider"),Pe=Symbol.for("react.context"),we=Symbol.for("react.server_context"),xe=Symbol.for("react.forward_ref"),$e=Symbol.for("react.suspense"),Oe=Symbol.for("react.suspense_list"),Ee=Symbol.for("react.memo"),Me=Symbol.for("react.lazy"),Ce=Symbol.for("react.offscreen"),je=Symbol.for("react.module.reference"); | ||
*/var D="function"==typeof Symbol&&Symbol.for,_=D?Symbol.for("react.element"):60103,L=D?Symbol.for("react.portal"):60106,V=D?Symbol.for("react.fragment"):60107,z=D?Symbol.for("react.strict_mode"):60108,W=D?Symbol.for("react.profiler"):60114,U=D?Symbol.for("react.provider"):60109,H=D?Symbol.for("react.context"):60110,A=D?Symbol.for("react.async_mode"):60111,I=D?Symbol.for("react.concurrent_mode"):60111,B=D?Symbol.for("react.forward_ref"):60112,G=D?Symbol.for("react.suspense"):60113,J=D?Symbol.for("react.suspense_list"):60120,K=D?Symbol.for("react.memo"):60115,Q=D?Symbol.for("react.lazy"):60116,X=D?Symbol.for("react.block"):60121,Y=D?Symbol.for("react.fundamental"):60117,Z=D?Symbol.for("react.responder"):60118,ee=D?Symbol.for("react.scope"):60119;function te(e){if("object"==typeof e&&null!==e){var t=e.$$typeof;switch(t){case _:switch(e=e.type){case A:case I:case V:case W:case z:case G:return e;default:switch(e=e&&e.$$typeof){case H:case B:case Q:case K:case U:return e;default:return t}}case L:return t}}}function ne(e){return te(e)===I}var re={AsyncMode:A,ConcurrentMode:I,ContextConsumer:H,ContextProvider:U,Element:_,ForwardRef:B,Fragment:V,Lazy:Q,Memo:K,Portal:L,Profiler:W,StrictMode:z,Suspense:G,isAsyncMode:function(e){return ne(e)||te(e)===A},isConcurrentMode:ne,isContextConsumer:function(e){return te(e)===H},isContextProvider:function(e){return te(e)===U},isElement:function(e){return"object"==typeof e&&null!==e&&e.$$typeof===_},isForwardRef:function(e){return te(e)===B},isFragment:function(e){return te(e)===V},isLazy:function(e){return te(e)===Q},isMemo:function(e){return te(e)===K},isPortal:function(e){return te(e)===L},isProfiler:function(e){return te(e)===W},isStrictMode:function(e){return te(e)===z},isSuspense:function(e){return te(e)===G},isValidElementType:function(e){return"string"==typeof e||"function"==typeof e||e===V||e===I||e===W||e===z||e===G||e===J||"object"==typeof e&&null!==e&&(e.$$typeof===Q||e.$$typeof===K||e.$$typeof===U||e.$$typeof===H||e.$$typeof===B||e.$$typeof===Y||e.$$typeof===Z||e.$$typeof===ee||e.$$typeof===X)},typeOf:te},oe=u((function(e){e.exports=re})),ue={childContextTypes:!0,contextType:!0,contextTypes:!0,defaultProps:!0,displayName:!0,getDefaultProps:!0,getDerivedStateFromError:!0,getDerivedStateFromProps:!0,mixins:!0,propTypes:!0,type:!0},ce={name:!0,length:!0,prototype:!0,caller:!0,callee:!0,arguments:!0,arity:!0},se={$$typeof:!0,compare:!0,defaultProps:!0,displayName:!0,propTypes:!0,type:!0},ae={};function ie(e){return oe.isMemo(e)?se:ae[e.$$typeof]||ue}ae[oe.ForwardRef]={$$typeof:!0,render:!0,defaultProps:!0,displayName:!0,propTypes:!0},ae[oe.Memo]=se;var fe=Object.defineProperty,le=Object.getOwnPropertyNames,pe=Object.getOwnPropertySymbols,de=Object.getOwnPropertyDescriptor,ye=Object.getPrototypeOf,me=Object.prototype;var be=function e(t,n,r){if("string"!=typeof n){if(me){var o=ye(n);o&&o!==me&&e(t,o,r)}var u=le(n);pe&&(u=u.concat(pe(n)));for(var c=ie(t),s=ie(n),a=0;u.length>a;++a){var i=u[a];if(!(ce[i]||r&&r[i]||s&&s[i]||c&&c[i])){var f=de(n,i);try{fe(t,i,f)}catch(e){}}}}return t},Se=Symbol.for("react.element"),ve=Symbol.for("react.portal"),he=Symbol.for("react.fragment"),ge=Symbol.for("react.strict_mode"),Pe=Symbol.for("react.profiler"),we=Symbol.for("react.provider"),xe=Symbol.for("react.context"),$e=Symbol.for("react.server_context"),Oe=Symbol.for("react.forward_ref"),Ce=Symbol.for("react.suspense"),Ee=Symbol.for("react.suspense_list"),Me=Symbol.for("react.memo"),je=Symbol.for("react.lazy"),Re=Symbol.for("react.offscreen"),Te=Symbol.for("react.module.reference"); | ||
/** | ||
@@ -19,2 +19,2 @@ * @license React | ||
* LICENSE file in the root directory of this source tree. | ||
*/function Re(e){if("object"==typeof e&&null!==e){var t=e.$$typeof;switch(t){case me:switch(e=e.type){case be:case ge:case ve:case $e:case Oe:return e;default:switch(e=e&&e.$$typeof){case we:case Pe:case xe:case Me:case Ee:case he:return e;default:return t}}case Se:return t}}}var Te={ContextConsumer:Pe,ContextProvider:he,Element:me,ForwardRef:xe,Fragment:be,Lazy:Me,Memo:Ee,Portal:Se,Profiler:ge,StrictMode:ve,Suspense:$e,SuspenseList:Oe,isAsyncMode:function(){return!1},isConcurrentMode:function(){return!1},isContextConsumer:function(e){return Re(e)===Pe},isContextProvider:function(e){return Re(e)===he},isElement:function(e){return"object"==typeof e&&null!==e&&e.$$typeof===me},isForwardRef:function(e){return Re(e)===xe},isFragment:function(e){return Re(e)===be},isLazy:function(e){return Re(e)===Me},isMemo:function(e){return Re(e)===Ee},isPortal:function(e){return Re(e)===Se},isProfiler:function(e){return Re(e)===ge},isStrictMode:function(e){return Re(e)===ve},isSuspense:function(e){return Re(e)===$e},isSuspenseList:function(e){return Re(e)===Oe},isValidElementType:function(e){return"string"==typeof e||"function"==typeof e||e===be||e===ge||e===ve||e===$e||e===Oe||e===Ce||"object"==typeof e&&null!==e&&(e.$$typeof===Me||e.$$typeof===Ee||e.$$typeof===he||e.$$typeof===Pe||e.$$typeof===xe||e.$$typeof===je||void 0!==e.getModuleId)},typeOf:Re},Ne=u((function(e){e.exports=Te}));const qe=["initMapStateToProps","initMapDispatchToProps","initMergeProps"];function De(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 Fe(e){return function(t){const r=e(t);function n(){return r}return n.dependsOnOwnProps=!1,n}}function _e(e){return e.dependsOnOwnProps?!!e.dependsOnOwnProps:1!==e.length}function ke(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=_e(e);let o=r(t,n);return"function"==typeof o&&(r.mapToProps=o,r.dependsOnOwnProps=_e(o),o=r(t,n)),o},r}}function Le(e,t){return(r,n)=>{throw Error(`Invalid value of type ${typeof e} for ${t} argument when connecting component ${n.wrappedComponentName}.`)}}function Ve(e,t,r){return N({},r,e,t)}const ze={notify(){},get:()=>[]};function We(e,t){let r,n=ze;function o(){c.onStateChange&&c.onStateChange()}function u(){r||(r=t?t.addNestedSub(o):e.subscribe(o),n=function(){const e=$();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=ze)},getListeners:()=>n};return c}const Ue=!("undefined"==typeof window||void 0===window.document||void 0===window.document.createElement)?t.useLayoutEffect:t.useEffect;function He(e,t){return e===t?0!==e||0!==t||1/e==1/t:e!=e&&t!=t}function Ae(e,t){if(He(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])||!He(e[r[n]],t[r[n]]))return!1;return!0}const Ie=["reactReduxForwardedRef"];let Be=M;const Ge=[null,null];function Je(e,t,r,n,o,u){e.current=n,r.current=!1,o.current&&(o.current=null,u())}function Ke(e,t){return e===t}function Qe(e=O){const r=e===O?E:()=>t.useContext(e);return function(){const{store:e}=r();return e}}const Xe=Qe();function Ye(e=O){const t=e===O?Xe:Qe(e);return function(){return t().dispatch}}const Ze=Ye();C=w.useSyncExternalStoreWithSelector,(e=>{Be=e})(y.useSyncExternalStore),x=r.unstable_batchedUpdates,Object.defineProperty(e,"batch",{enumerable:!0,get:function(){return r.unstable_batchedUpdates}}),e.Provider=function({store:e,context:r,children:n,serverState:u}){const c=t.useMemo((()=>{const t=We(e);return{store:e,subscription:t,getServerState:u?()=>u:void 0}}),[e,u]),s=t.useMemo((()=>e.getState()),[e]);return Ue((()=>{const{subscription:t}=c;return t.onStateChange=t.notifyNestedSubs,t.trySubscribe(),s!==e.getState()&&t.notifyNestedSubs(),()=>{t.tryUnsubscribe(),t.onStateChange=void 0}}),[c,s]),o.default.createElement((r||O).Provider,{value:c},n)},e.ReactReduxContext=O,e.connect=function(e,r,n,{areStatesEqual:u=Ke,areOwnPropsEqual:c=Ae,areStatePropsEqual:s=Ae,areMergedPropsEqual:a=Ae,forwardRef:i=!1,context:f=O}={}){const l=f,p=function(e){return e?"function"==typeof e?ke(e):Le(e,"mapStateToProps"):Fe((()=>({})))}(e),d=function(e){return e&&"object"==typeof e?Fe((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?ke(e):Le(e,"mapDispatchToProps"):Fe((e=>({dispatch:e})))}(r),y=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):Le(e,"mergeProps"):()=>Ve}(n),m=!!e;return e=>{const r=e.displayName||e.name||"Component",n=`Connect(${r})`,f={shouldHandleStateChanges:m,displayName:n,wrappedComponentName:r,WrappedComponent:e,initMapStateToProps:p,initMapDispatchToProps:d,initMergeProps:y,areStatesEqual:u,areStatePropsEqual:s,areOwnPropsEqual:c,areMergedPropsEqual:a};function S(r){const[n,u,c]=t.useMemo((()=>{const{reactReduxForwardedRef:e}=r,t=q(r,Ie);return[r.context,e,t]}),[r]),s=t.useMemo((()=>n&&n.Consumer&&Ne.isContextConsumer(o.default.createElement(n.Consumer,null))?n:l),[n,l]),a=t.useContext(s),i=!!r.store&&!!r.store.getState&&!!r.store.dispatch,p=i?r.store:a.store,d=!!a&&!!a.store?a.getServerState:p.getState,y=t.useMemo((()=>function(e,t){let{initMapStateToProps:r,initMapDispatchToProps:n,initMergeProps:o}=t,u=q(t,qe);return De(r(e,u),n(e,u),o(e,u),e,u)}(p.dispatch,f)),[p]),[S,b]=t.useMemo((()=>{if(!m)return Ge;const e=We(p,i?void 0:a.subscription),t=e.notifyNestedSubs.bind(e);return[e,t]}),[p,i,a]),v=t.useMemo((()=>i?a:N({},a,{subscription:S})),[i,a,S]),g=t.useRef(),h=t.useRef(c),P=t.useRef(),w=t.useRef(!1);t.useRef(!1);const x=t.useRef(!1),$=t.useRef();Ue((()=>(x.current=!0,()=>{x.current=!1})),[]);const O=t.useMemo((()=>()=>P.current&&c===h.current?P.current:y(p.getState(),c)),[p,c]),E=t.useMemo((()=>e=>S?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}}(m,p,S,y,h,g,w,x,P,b,e):()=>{}),[S]);var M,C,j;let R;M=Je,C=[h,g,w,c,P,b],Ue((()=>M(...C)),j);try{R=Be(E,O,d?()=>y(d(),c):O)}catch(e){throw $.current&&(e.message+=`\nThe error may be correlated with this previous error:\n${$.current.stack}\n\n`),e}Ue((()=>{$.current=void 0,P.current=void 0,g.current=R}));const T=t.useMemo((()=>o.default.createElement(e,N({},R,{ref:u}))),[u,e,R]);return t.useMemo((()=>m?o.default.createElement(s.Provider,{value:v},T):T),[s,T,v])}const b=o.default.memo(S);if(b.WrappedComponent=e,b.displayName=S.displayName=n,i){const t=o.default.forwardRef((function(e,t){return o.default.createElement(b,N({},e,{reactReduxForwardedRef:t}))}));return t.displayName=n,t.WrappedComponent=e,ye(t,e)}return ye(b,e)}},e.createDispatchHook=Ye,e.createSelectorHook=R,e.createStoreHook=Qe,e.shallowEqual=Ae,e.useDispatch=Ze,e.useSelector=T,e.useStore=Xe,Object.defineProperty(e,"__esModule",{value:!0})})); | ||
*/function qe(e){if("object"==typeof e&&null!==e){var t=e.$$typeof;switch(t){case Se:switch(e=e.type){case he:case Pe:case ge:case Ce:case Ee:return e;default:switch(e=e&&e.$$typeof){case $e:case xe:case Oe:case je:case Me:case we:return e;default:return t}}case ve:return t}}}var Ne={ContextConsumer:xe,ContextProvider:we,Element:Se,ForwardRef:Oe,Fragment:he,Lazy:je,Memo:Me,Portal:ve,Profiler:Pe,StrictMode:ge,Suspense:Ce,SuspenseList:Ee,isAsyncMode:function(){return!1},isConcurrentMode:function(){return!1},isContextConsumer:function(e){return qe(e)===xe},isContextProvider:function(e){return qe(e)===we},isElement:function(e){return"object"==typeof e&&null!==e&&e.$$typeof===Se},isForwardRef:function(e){return qe(e)===Oe},isFragment:function(e){return qe(e)===he},isLazy:function(e){return qe(e)===je},isMemo:function(e){return qe(e)===Me},isPortal:function(e){return qe(e)===ve},isProfiler:function(e){return qe(e)===Pe},isStrictMode:function(e){return qe(e)===ge},isSuspense:function(e){return qe(e)===Ce},isSuspenseList:function(e){return qe(e)===Ee},isValidElementType:function(e){return"string"==typeof e||"function"==typeof e||e===he||e===Pe||e===ge||e===Ce||e===Ee||e===Re||"object"==typeof e&&null!==e&&(e.$$typeof===je||e.$$typeof===Me||e.$$typeof===we||e.$$typeof===xe||e.$$typeof===Oe||e.$$typeof===Te||void 0!==e.getModuleId)},typeOf:qe},ke=u((function(e){e.exports=Ne}));const Fe=["initMapStateToProps","initMapDispatchToProps","initMergeProps"];function De(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 _e(e){return function(t){const n=e(t);function r(){return n}return r.dependsOnOwnProps=!1,r}}function Le(e){return e.dependsOnOwnProps?!!e.dependsOnOwnProps:1!==e.length}function Ve(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=Le(e);let o=n(t,r);return"function"==typeof o&&(n.mapToProps=o,n.dependsOnOwnProps=Le(o),o=n(t,r)),o},n}}function ze(e,t){return(n,r)=>{throw Error(`Invalid value of type ${typeof e} for ${t} argument when connecting component ${r.wrappedComponentName}.`)}}function We(e,t,n){return k({},n,e,t)}const Ue={notify(){},get:()=>[]};function He(e,t){let n,r=Ue;function o(){c.onStateChange&&c.onStateChange()}function u(){n||(n=t?t.addNestedSub(o):e.subscribe(o),r=function(){const e=$();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)}}}}())}const c={addNestedSub:function(e){return u(),r.subscribe(e)},notifyNestedSubs:function(){r.notify()},handleChangeWrapper:o,isSubscribed:function(){return!!n},trySubscribe:u,tryUnsubscribe:function(){n&&(n(),n=void 0,r.clear(),r=Ue)},getListeners:()=>r};return c}const Ae=!("undefined"==typeof window||void 0===window.document||void 0===window.document.createElement)?t.useLayoutEffect:t.useEffect;function Ie(e,t){return e===t?0!==e||0!==t||1/e==1/t:e!=e&&t!=t}function Be(e,t){if(Ie(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])||!Ie(e[n[r]],t[n[r]]))return!1;return!0}const Ge=["reactReduxForwardedRef"];let Je=j;const Ke=[null,null];function Qe(e,t,n,r,o,u){e.current=r,n.current=!1,o.current&&(o.current=null,u())}function Xe(e,t){return e===t}function Ye(e=C){const t=e===C?M:E(e);return function(){const{store:e}=t();return e}}const Ze=Ye();function et(e=C){const t=e===C?Ze:Ye(e);return function(){return t().dispatch}}const tt=et();R=w.useSyncExternalStoreWithSelector,(e=>{Je=e})(y.useSyncExternalStore),x=n.unstable_batchedUpdates,Object.defineProperty(e,"batch",{enumerable:!0,get:function(){return n.unstable_batchedUpdates}}),e.Provider=function({store:e,context:n,children:r,serverState:u,stabilityCheck:c="once",noopCheck:s="once"}){const a=t.useMemo((()=>{const t=He(e);return{store:e,subscription:t,getServerState:u?()=>u:void 0,stabilityCheck:c,noopCheck:s}}),[e,u,c,s]),i=t.useMemo((()=>e.getState()),[e]);return Ae((()=>{const{subscription:t}=a;return t.onStateChange=t.notifyNestedSubs,t.trySubscribe(),i!==e.getState()&&t.notifyNestedSubs(),()=>{t.tryUnsubscribe(),t.onStateChange=void 0}}),[a,i]),o.default.createElement((n||C).Provider,{value:a},r)},e.ReactReduxContext=C,e.connect=function(e,n,r,{areStatesEqual:u=Xe,areOwnPropsEqual:c=Be,areStatePropsEqual:s=Be,areMergedPropsEqual:a=Be,forwardRef:i=!1,context:f=C}={}){const l=f,p=function(e){return e?"function"==typeof e?Ve(e):ze(e,"mapStateToProps"):_e((()=>({})))}(e),d=function(e){return e&&"object"==typeof e?_e((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?Ve(e):ze(e,"mapDispatchToProps"):_e((e=>({dispatch:e})))}(n),y=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):ze(e,"mergeProps"):()=>We}(r),m=!!e;return e=>{const n=e.displayName||e.name||"Component",r=`Connect(${n})`,f={shouldHandleStateChanges:m,displayName:r,wrappedComponentName:n,WrappedComponent:e,initMapStateToProps:p,initMapDispatchToProps:d,initMergeProps:y,areStatesEqual:u,areStatePropsEqual:s,areOwnPropsEqual:c,areMergedPropsEqual:a};function b(n){const[r,u,c]=t.useMemo((()=>{const{reactReduxForwardedRef:e}=n,t=F(n,Ge);return[n.context,e,t]}),[n]),s=t.useMemo((()=>r&&r.Consumer&&ke.isContextConsumer(o.default.createElement(r.Consumer,null))?r:l),[r,l]),a=t.useContext(s),i=!!n.store&&!!n.store.getState&&!!n.store.dispatch,p=i?n.store:a.store,d=!!a&&!!a.store?a.getServerState:p.getState,y=t.useMemo((()=>function(e,t){let{initMapStateToProps:n,initMapDispatchToProps:r,initMergeProps:o}=t,u=F(t,Fe);return De(n(e,u),r(e,u),o(e,u),e,u)}(p.dispatch,f)),[p]),[b,S]=t.useMemo((()=>{if(!m)return Ke;const e=He(p,i?void 0:a.subscription),t=e.notifyNestedSubs.bind(e);return[e,t]}),[p,i,a]),v=t.useMemo((()=>i?a:k({},a,{subscription:b})),[i,a,b]),h=t.useRef(),g=t.useRef(c),P=t.useRef(),w=t.useRef(!1);t.useRef(!1);const x=t.useRef(!1),$=t.useRef();Ae((()=>(x.current=!0,()=>{x.current=!1})),[]);const O=t.useMemo((()=>()=>P.current&&c===g.current?P.current:y(p.getState(),c)),[p,c]),C=t.useMemo((()=>e=>b?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}}(m,p,b,y,g,h,w,x,P,S,e):()=>{}),[b]);var E,M,j;let R;E=Qe,M=[g,h,w,c,P,S],Ae((()=>E(...M)),j);try{R=Je(C,O,d?()=>y(d(),c):O)}catch(e){throw $.current&&(e.message+=`\nThe error may be correlated with this previous error:\n${$.current.stack}\n\n`),e}Ae((()=>{$.current=void 0,P.current=void 0,h.current=R}));const T=t.useMemo((()=>o.default.createElement(e,k({},R,{ref:u}))),[u,e,R]);return t.useMemo((()=>m?o.default.createElement(s.Provider,{value:v},T):T),[s,T,v])}const S=o.default.memo(b);if(S.WrappedComponent=e,S.displayName=b.displayName=r,i){const t=o.default.forwardRef((function(e,t){return o.default.createElement(S,k({},e,{reactReduxForwardedRef:t}))}));return t.displayName=r,t.WrappedComponent=e,be(t,e)}return be(S,e)}},e.createDispatchHook=et,e.createSelectorHook=q,e.createStoreHook=Ye,e.shallowEqual=Be,e.useDispatch=tt,e.useSelector=N,e.useStore=Ze,Object.defineProperty(e,"__esModule",{value:!0})})); |
import type { Store } from 'redux'; | ||
import type { InferableComponentEnhancer, InferableComponentEnhancerWithProps, ResolveThunks, DispatchProp } from '../types'; | ||
import { MapStateToPropsParam, MapDispatchToPropsParam, MergeProps, MapDispatchToPropsNonObject } from '../connect/selectorFactory'; | ||
import { ReactReduxContext, ReactReduxContextInstance } from './Context'; | ||
import type { MapStateToPropsParam, MapDispatchToPropsParam, MergeProps, MapDispatchToPropsNonObject } from '../connect/selectorFactory'; | ||
import type { ReactReduxContextInstance } from './Context'; | ||
import { ReactReduxContext } from './Context'; | ||
import type { uSES } from '../utils/useSyncExternalStore'; | ||
@@ -6,0 +7,0 @@ export declare const initializeConnect: (fn: uSES) => void; |
@@ -1,4 +0,5 @@ | ||
/// <reference types="react" /> | ||
import type { Context } from 'react'; | ||
import type { Action, AnyAction, Store } from 'redux'; | ||
import type { Subscription } from '../utils/Subscription'; | ||
import type { CheckFrequency } from '../hooks/useSelector'; | ||
export interface ReactReduxContextValue<SS = any, A extends Action = AnyAction> { | ||
@@ -8,5 +9,7 @@ store: Store<SS, A>; | ||
getServerState?: () => SS; | ||
stabilityCheck: CheckFrequency; | ||
noopCheck: CheckFrequency; | ||
} | ||
export declare const ReactReduxContext: import("react").Context<ReactReduxContextValue<any, AnyAction>>; | ||
export declare const ReactReduxContext: Context<ReactReduxContextValue<any, AnyAction>>; | ||
export declare type ReactReduxContextInstance = typeof ReactReduxContext; | ||
export default ReactReduxContext; |
import { createContext } from 'react'; | ||
export const ReactReduxContext = /*#__PURE__*/createContext(null); | ||
let realContext = null; | ||
if (process.env.NODE_ENV !== 'production') { | ||
ReactReduxContext.displayName = 'ReactRedux'; | ||
function getContext() { | ||
if (!realContext) { | ||
realContext = createContext(null); | ||
if (process.env.NODE_ENV !== 'production') { | ||
realContext.displayName = 'ReactRedux'; | ||
} | ||
} | ||
return realContext; | ||
} | ||
export const ReactReduxContext = /*#__PURE__*/new Proxy({}, /*#__PURE__*/new Proxy({}, { | ||
get(_, handler) { | ||
const target = getContext(); // @ts-ignore | ||
return (_target, ...args) => Reflect[handler](target, ...args); | ||
} | ||
})); | ||
export default ReactReduxContext; |
@@ -1,4 +0,5 @@ | ||
import { Context, ReactNode } from 'react'; | ||
import { ReactReduxContextValue } from './Context'; | ||
import { Action, AnyAction, Store } from 'redux'; | ||
import type { Context, ReactNode } from 'react'; | ||
import type { ReactReduxContextValue } from './Context'; | ||
import type { Action, AnyAction, Store } from 'redux'; | ||
import type { CheckFrequency } from '../hooks/useSelector'; | ||
export interface ProviderProps<A extends Action = AnyAction, S = unknown> { | ||
@@ -19,5 +20,9 @@ /** | ||
context?: Context<ReactReduxContextValue<S, A>>; | ||
/** Global configuration for the `useSelector` stability check */ | ||
stabilityCheck?: CheckFrequency; | ||
/** Global configuration for the `useSelector` no-op check */ | ||
noopCheck?: CheckFrequency; | ||
children: ReactNode; | ||
} | ||
declare function Provider<A extends Action = AnyAction, S = unknown>({ store, context, children, serverState, }: ProviderProps<A, S>): JSX.Element; | ||
declare function Provider<A extends Action = AnyAction, S = unknown>({ store, context, children, serverState, stabilityCheck, noopCheck, }: ProviderProps<A, S>): JSX.Element; | ||
export default Provider; |
@@ -10,3 +10,5 @@ import React, { useMemo } from 'react'; | ||
children, | ||
serverState | ||
serverState, | ||
stabilityCheck = 'once', | ||
noopCheck = 'once' | ||
}) { | ||
@@ -18,5 +20,7 @@ const contextValue = useMemo(() => { | ||
subscription, | ||
getServerState: serverState ? () => serverState : undefined | ||
getServerState: serverState ? () => serverState : undefined, | ||
stabilityCheck, | ||
noopCheck | ||
}; | ||
}, [store, serverState]); | ||
}, [store, serverState, stabilityCheck, noopCheck]); | ||
const previousState = useMemo(() => store.getState(), [store]); | ||
@@ -23,0 +27,0 @@ useIsomorphicLayoutEffect(() => { |
@@ -1,3 +0,3 @@ | ||
import { ActionCreatorsMapObject, Dispatch, ActionCreator } from 'redux'; | ||
import { FixTypeLater } from '../types'; | ||
import type { ActionCreatorsMapObject, Dispatch, ActionCreator } from 'redux'; | ||
import type { FixTypeLater } from '../types'; | ||
declare type AnyState = { | ||
@@ -4,0 +4,0 @@ [key: string]: any; |
@@ -1,4 +0,4 @@ | ||
import { Action, AnyAction, Dispatch } from 'redux'; | ||
import { Context } from 'react'; | ||
import { ReactReduxContextValue } from '../components/Context'; | ||
import type { Action, AnyAction, Dispatch } from 'redux'; | ||
import type { Context } from 'react'; | ||
import type { ReactReduxContextValue } from '../components/Context'; | ||
/** | ||
@@ -5,0 +5,0 @@ * Hook factory, which creates a `useDispatch` hook bound to a given context. |
@@ -0,3 +1,12 @@ | ||
/// <reference types="react" /> | ||
import type { ReactReduxContextValue } from '../components/Context'; | ||
/** | ||
* Hook factory, which creates a `useReduxContext` hook bound to a given context. This is a low-level | ||
* hook that you should usually not need to call directly. | ||
* | ||
* @param {React.Context} [context=ReactReduxContext] Context passed to your `<Provider>`. | ||
* @returns {Function} A `useReduxContext` hook bound to the specified context. | ||
*/ | ||
export declare function createReduxContextHook(context?: import("react").Context<ReactReduxContextValue<any, import("redux").AnyAction>>): () => ReactReduxContextValue | null; | ||
/** | ||
* A hook to access the value of the `ReactReduxContext`. This is a low-level | ||
@@ -18,2 +27,2 @@ * hook that you should usually not need to call directly. | ||
*/ | ||
export declare function useReduxContext(): ReactReduxContextValue | null; | ||
export declare const useReduxContext: () => ReactReduxContextValue | null; |
@@ -5,2 +5,20 @@ import { useContext } from 'react'; | ||
/** | ||
* Hook factory, which creates a `useReduxContext` hook bound to a given context. This is a low-level | ||
* hook that you should usually not need to call directly. | ||
* | ||
* @param {React.Context} [context=ReactReduxContext] Context passed to your `<Provider>`. | ||
* @returns {Function} A `useReduxContext` hook bound to the specified context. | ||
*/ | ||
export function createReduxContextHook(context = ReactReduxContext) { | ||
return function useReduxContext() { | ||
const contextValue = useContext(context); | ||
if (process.env.NODE_ENV !== 'production' && !contextValue) { | ||
throw new Error('could not find react-redux context value; please ensure the component is wrapped in a <Provider>'); | ||
} | ||
return contextValue; | ||
}; | ||
} | ||
/** | ||
* A hook to access the value of the `ReactReduxContext`. This is a low-level | ||
@@ -21,10 +39,3 @@ * hook that you should usually not need to call directly. | ||
*/ | ||
export function useReduxContext() { | ||
const contextValue = useContext(ReactReduxContext); | ||
if (process.env.NODE_ENV !== 'production' && !contextValue) { | ||
throw new Error('could not find react-redux context value; please ensure the component is wrapped in a <Provider>'); | ||
} | ||
return contextValue; | ||
} | ||
export const useReduxContext = /*#__PURE__*/createReduxContextHook(); |
/// <reference types="react" /> | ||
import type { EqualityFn } from '../types'; | ||
import type { uSESWS } from '../utils/useSyncExternalStore'; | ||
export declare type CheckFrequency = 'never' | 'once' | 'always'; | ||
export interface UseSelectorOptions<Selected = unknown> { | ||
equalityFn?: EqualityFn<Selected>; | ||
stabilityCheck?: CheckFrequency; | ||
noopCheck?: CheckFrequency; | ||
} | ||
interface UseSelector { | ||
<TState = unknown, Selected = unknown>(selector: (state: TState) => Selected, equalityFn?: EqualityFn<Selected>): Selected; | ||
<TState = unknown, Selected = unknown>(selector: (state: TState) => Selected, options?: UseSelectorOptions<Selected>): Selected; | ||
} | ||
export declare const initializeUseSelector: (fn: uSESWS) => void; | ||
@@ -11,3 +21,3 @@ /** | ||
*/ | ||
export declare function createSelectorHook(context?: import("react").Context<import("../components/Context").ReactReduxContextValue<any, import("redux").AnyAction>>): <TState = unknown, Selected = unknown>(selector: (state: TState) => Selected, equalityFn?: EqualityFn<Selected>) => Selected; | ||
export declare function createSelectorHook(context?: import("react").Context<import("../components/Context").ReactReduxContextValue<any, import("redux").AnyAction>>): UseSelector; | ||
/** | ||
@@ -36,2 +46,3 @@ * A hook to access the redux store's state. This hook takes a selector function | ||
*/ | ||
export declare const useSelector: <TState = unknown, Selected = unknown>(selector: (state: TState) => Selected, equalityFn?: EqualityFn<Selected> | undefined) => Selected; | ||
export declare const useSelector: UseSelector; | ||
export {}; |
@@ -1,3 +0,3 @@ | ||
import { useContext, useDebugValue } from 'react'; | ||
import { useReduxContext as useDefaultReduxContext } from './useReduxContext'; | ||
import { useCallback, useDebugValue, useRef } from 'react'; | ||
import { createReduxContextHook, useReduxContext as useDefaultReduxContext } from './useReduxContext'; | ||
import { ReactReduxContext } from '../components/Context'; | ||
@@ -20,4 +20,12 @@ import { notInitialized } from '../utils/useSyncExternalStore'; | ||
export function createSelectorHook(context = ReactReduxContext) { | ||
const useReduxContext = context === ReactReduxContext ? useDefaultReduxContext : () => useContext(context); | ||
return function useSelector(selector, equalityFn = refEquality) { | ||
const useReduxContext = context === ReactReduxContext ? useDefaultReduxContext : createReduxContextHook(context); | ||
return function useSelector(selector, equalityFnOrOptions = {}) { | ||
const { | ||
equalityFn = refEquality, | ||
stabilityCheck = undefined, | ||
noopCheck = undefined | ||
} = typeof equalityFnOrOptions === 'function' ? { | ||
equalityFn: equalityFnOrOptions | ||
} : equalityFnOrOptions; | ||
if (process.env.NODE_ENV !== 'production') { | ||
@@ -40,5 +48,43 @@ if (!selector) { | ||
subscription, | ||
getServerState | ||
getServerState, | ||
stabilityCheck: globalStabilityCheck, | ||
noopCheck: globalNoopCheck | ||
} = useReduxContext(); | ||
const selectedState = useSyncExternalStoreWithSelector(subscription.addNestedSub, store.getState, getServerState || store.getState, selector, equalityFn); | ||
const firstRun = useRef(true); | ||
const wrappedSelector = useCallback({ | ||
[selector.name](state) { | ||
const selected = selector(state); | ||
if (process.env.NODE_ENV !== 'production') { | ||
const finalStabilityCheck = typeof stabilityCheck === 'undefined' ? globalStabilityCheck : stabilityCheck; | ||
if (finalStabilityCheck === 'always' || finalStabilityCheck === 'once' && firstRun.current) { | ||
const toCompare = selector(state); | ||
if (!equalityFn(selected, toCompare)) { | ||
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 | ||
}); | ||
} | ||
} | ||
const finalNoopCheck = typeof noopCheck === 'undefined' ? globalNoopCheck : noopCheck; | ||
if (finalNoopCheck === 'always' || finalNoopCheck === 'once' && firstRun.current) { | ||
// @ts-ignore | ||
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.'); | ||
} | ||
} | ||
if (firstRun.current) firstRun.current = false; | ||
} | ||
return selected; | ||
} | ||
}[selector.name], [selector, globalStabilityCheck, stabilityCheck]); | ||
const selectedState = useSyncExternalStoreWithSelector(subscription.addNestedSub, store.getState, getServerState || store.getState, wrappedSelector, equalityFn); | ||
useDebugValue(selectedState); | ||
@@ -45,0 +91,0 @@ return selectedState; |
@@ -1,4 +0,4 @@ | ||
import { Context } from 'react'; | ||
import { Action as BasicAction, AnyAction, Store } from 'redux'; | ||
import { ReactReduxContextValue } from '../components/Context'; | ||
import type { Context } from 'react'; | ||
import type { Action as BasicAction, AnyAction, Store } from 'redux'; | ||
import type { ReactReduxContextValue } from '../components/Context'; | ||
/** | ||
@@ -5,0 +5,0 @@ * Hook factory, which creates a `useStore` hook bound to a given context. |
@@ -1,4 +0,3 @@ | ||
import { useContext } from 'react'; | ||
import { ReactReduxContext } from '../components/Context'; | ||
import { useReduxContext as useDefaultReduxContext } from './useReduxContext'; | ||
import { useReduxContext as useDefaultReduxContext, createReduxContextHook } from './useReduxContext'; | ||
/** | ||
@@ -13,3 +12,4 @@ * Hook factory, which creates a `useStore` hook bound to a given context. | ||
const useReduxContext = // @ts-ignore | ||
context === ReactReduxContext ? useDefaultReduxContext : () => useContext(context); | ||
context === ReactReduxContext ? useDefaultReduxContext : // @ts-ignore | ||
createReduxContextHook(context); | ||
return function useStore() { | ||
@@ -16,0 +16,0 @@ const { |
@@ -1,5 +0,6 @@ | ||
import { ClassAttributes, ComponentClass, ComponentType, FunctionComponent } from 'react'; | ||
import { Action, AnyAction, Dispatch } from 'redux'; | ||
import type { ClassAttributes, ComponentClass, ComponentType, FunctionComponent } from 'react'; | ||
import type { Action, AnyAction, Dispatch } from 'redux'; | ||
import type { NonReactStatics } from 'hoist-non-react-statics'; | ||
import type { ConnectProps } from './components/connect'; | ||
import type { UseSelectorOptions } from './hooks/useSelector'; | ||
export declare type FixTypeLater = any; | ||
@@ -76,4 +77,5 @@ export declare type EqualityFn<T> = (a: T, b: T) => boolean; | ||
<TSelected>(selector: (state: TState) => TSelected, equalityFn?: EqualityFn<NoInfer<TSelected>>): TSelected; | ||
<Selected = unknown>(selector: (state: TState) => Selected, options?: UseSelectorOptions<Selected>): Selected; | ||
} | ||
export declare type NoInfer<T> = [T][T extends any ? 0 : never]; | ||
export {}; |
@@ -1,2 +0,2 @@ | ||
import { ActionCreatorsMapObject, Dispatch } from 'redux'; | ||
import type { ActionCreatorsMapObject, Dispatch } from 'redux'; | ||
export default function bindActionCreators(actionCreators: ActionCreatorsMapObject, dispatch: Dispatch): ActionCreatorsMapObject; |
@@ -8,10 +8,26 @@ "use strict"; | ||
const ReactReduxContext = /*#__PURE__*/(0, _react.createContext)(null); | ||
exports.ReactReduxContext = ReactReduxContext; | ||
let realContext = null; | ||
if (process.env.NODE_ENV !== 'production') { | ||
ReactReduxContext.displayName = 'ReactRedux'; | ||
function getContext() { | ||
if (!realContext) { | ||
realContext = (0, _react.createContext)(null); | ||
if (process.env.NODE_ENV !== 'production') { | ||
realContext.displayName = 'ReactRedux'; | ||
} | ||
} | ||
return realContext; | ||
} | ||
const ReactReduxContext = /*#__PURE__*/new Proxy({}, /*#__PURE__*/new Proxy({}, { | ||
get(_, handler) { | ||
const target = getContext(); // @ts-ignore | ||
return (_target, ...args) => Reflect[handler](target, ...args); | ||
} | ||
})); | ||
exports.ReactReduxContext = ReactReduxContext; | ||
var _default = ReactReduxContext; | ||
exports.default = _default; |
@@ -22,3 +22,5 @@ "use strict"; | ||
children, | ||
serverState | ||
serverState, | ||
stabilityCheck = 'once', | ||
noopCheck = 'once' | ||
}) { | ||
@@ -30,5 +32,7 @@ const contextValue = (0, _react.useMemo)(() => { | ||
subscription, | ||
getServerState: serverState ? () => serverState : undefined | ||
getServerState: serverState ? () => serverState : undefined, | ||
stabilityCheck, | ||
noopCheck | ||
}; | ||
}, [store, serverState]); | ||
}, [store, serverState, stabilityCheck, noopCheck]); | ||
const previousState = (0, _react.useMemo)(() => store.getState(), [store]); | ||
@@ -35,0 +39,0 @@ (0, _useIsomorphicLayoutEffect.useIsomorphicLayoutEffect)(() => { |
"use strict"; | ||
exports.__esModule = true; | ||
exports.useReduxContext = useReduxContext; | ||
exports.createReduxContextHook = createReduxContextHook; | ||
exports.useReduxContext = void 0; | ||
@@ -11,2 +12,20 @@ var _react = require("react"); | ||
/** | ||
* Hook factory, which creates a `useReduxContext` hook bound to a given context. This is a low-level | ||
* hook that you should usually not need to call directly. | ||
* | ||
* @param {React.Context} [context=ReactReduxContext] Context passed to your `<Provider>`. | ||
* @returns {Function} A `useReduxContext` hook bound to the specified context. | ||
*/ | ||
function createReduxContextHook(context = _Context.ReactReduxContext) { | ||
return function useReduxContext() { | ||
const contextValue = (0, _react.useContext)(context); | ||
if (process.env.NODE_ENV !== 'production' && !contextValue) { | ||
throw new Error('could not find react-redux context value; please ensure the component is wrapped in a <Provider>'); | ||
} | ||
return contextValue; | ||
}; | ||
} | ||
/** | ||
* A hook to access the value of the `ReactReduxContext`. This is a low-level | ||
@@ -27,10 +46,5 @@ * hook that you should usually not need to call directly. | ||
*/ | ||
function useReduxContext() { | ||
const contextValue = (0, _react.useContext)(_Context.ReactReduxContext); | ||
if (process.env.NODE_ENV !== 'production' && !contextValue) { | ||
throw new Error('could not find react-redux context value; please ensure the component is wrapped in a <Provider>'); | ||
} | ||
return contextValue; | ||
} | ||
const useReduxContext = /*#__PURE__*/createReduxContextHook(); | ||
exports.useReduxContext = useReduxContext; |
@@ -33,4 +33,12 @@ "use strict"; | ||
function createSelectorHook(context = _Context.ReactReduxContext) { | ||
const useReduxContext = context === _Context.ReactReduxContext ? _useReduxContext.useReduxContext : () => (0, _react.useContext)(context); | ||
return function useSelector(selector, equalityFn = refEquality) { | ||
const useReduxContext = context === _Context.ReactReduxContext ? _useReduxContext.useReduxContext : (0, _useReduxContext.createReduxContextHook)(context); | ||
return function useSelector(selector, equalityFnOrOptions = {}) { | ||
const { | ||
equalityFn = refEquality, | ||
stabilityCheck = undefined, | ||
noopCheck = undefined | ||
} = typeof equalityFnOrOptions === 'function' ? { | ||
equalityFn: equalityFnOrOptions | ||
} : equalityFnOrOptions; | ||
if (process.env.NODE_ENV !== 'production') { | ||
@@ -53,5 +61,43 @@ if (!selector) { | ||
subscription, | ||
getServerState | ||
getServerState, | ||
stabilityCheck: globalStabilityCheck, | ||
noopCheck: globalNoopCheck | ||
} = useReduxContext(); | ||
const selectedState = useSyncExternalStoreWithSelector(subscription.addNestedSub, store.getState, getServerState || store.getState, selector, equalityFn); | ||
const firstRun = (0, _react.useRef)(true); | ||
const wrappedSelector = (0, _react.useCallback)({ | ||
[selector.name](state) { | ||
const selected = selector(state); | ||
if (process.env.NODE_ENV !== 'production') { | ||
const finalStabilityCheck = typeof stabilityCheck === 'undefined' ? globalStabilityCheck : stabilityCheck; | ||
if (finalStabilityCheck === 'always' || finalStabilityCheck === 'once' && firstRun.current) { | ||
const toCompare = selector(state); | ||
if (!equalityFn(selected, toCompare)) { | ||
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 | ||
}); | ||
} | ||
} | ||
const finalNoopCheck = typeof noopCheck === 'undefined' ? globalNoopCheck : noopCheck; | ||
if (finalNoopCheck === 'always' || finalNoopCheck === 'once' && firstRun.current) { | ||
// @ts-ignore | ||
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.'); | ||
} | ||
} | ||
if (firstRun.current) firstRun.current = false; | ||
} | ||
return selected; | ||
} | ||
}[selector.name], [selector, globalStabilityCheck, stabilityCheck]); | ||
const selectedState = useSyncExternalStoreWithSelector(subscription.addNestedSub, store.getState, getServerState || store.getState, wrappedSelector, equalityFn); | ||
(0, _react.useDebugValue)(selectedState); | ||
@@ -58,0 +104,0 @@ return selectedState; |
@@ -7,4 +7,2 @@ "use strict"; | ||
var _react = require("react"); | ||
var _Context = require("../components/Context"); | ||
@@ -22,3 +20,4 @@ | ||
const useReduxContext = // @ts-ignore | ||
context === _Context.ReactReduxContext ? _useReduxContext.useReduxContext : () => (0, _react.useContext)(context); | ||
context === _Context.ReactReduxContext ? _useReduxContext.useReduxContext : // @ts-ignore | ||
(0, _useReduxContext.createReduxContextHook)(context); | ||
return function useStore() { | ||
@@ -25,0 +24,0 @@ const { |
{ | ||
"name": "react-redux", | ||
"version": "8.0.7", | ||
"version": "8.1.0", | ||
"description": "Official React bindings for Redux", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
import { createContext } from 'react' | ||
import type { Context } from 'react' | ||
import type { Action, AnyAction, Store } from 'redux' | ||
import type { Subscription } from '../utils/Subscription' | ||
import type { CheckFrequency } from '../hooks/useSelector' | ||
@@ -12,13 +14,33 @@ export interface ReactReduxContextValue< | ||
getServerState?: () => SS | ||
stabilityCheck: CheckFrequency | ||
noopCheck: CheckFrequency | ||
} | ||
export const ReactReduxContext = | ||
/*#__PURE__*/ createContext<ReactReduxContextValue>(null as any) | ||
let realContext: Context<ReactReduxContextValue> | null = null | ||
function getContext() { | ||
if (!realContext) { | ||
realContext = createContext<ReactReduxContextValue>(null as any) | ||
if (process.env.NODE_ENV !== 'production') { | ||
realContext.displayName = 'ReactRedux' | ||
} | ||
} | ||
return realContext | ||
} | ||
export const ReactReduxContext = /*#__PURE__*/ new Proxy( | ||
{} as Context<ReactReduxContextValue>, | ||
/*#__PURE__*/ new Proxy<ProxyHandler<Context<ReactReduxContextValue>>>( | ||
{}, | ||
{ | ||
get(_, handler) { | ||
const target = getContext() | ||
// @ts-ignore | ||
return (_target, ...args) => Reflect[handler](target, ...args) | ||
}, | ||
} | ||
) | ||
) | ||
export type ReactReduxContextInstance = typeof ReactReduxContext | ||
if (process.env.NODE_ENV !== 'production') { | ||
ReactReduxContext.displayName = 'ReactRedux' | ||
} | ||
export default ReactReduxContext |
@@ -1,4 +0,4 @@ | ||
import { ActionCreatorsMapObject, Dispatch, ActionCreator } from 'redux' | ||
import type { ActionCreatorsMapObject, Dispatch, ActionCreator } from 'redux' | ||
import { FixTypeLater } from '../types' | ||
import type { FixTypeLater } from '../types' | ||
import verifyPlainObject from '../utils/verifyPlainObject' | ||
@@ -5,0 +5,0 @@ |
@@ -1,8 +0,6 @@ | ||
import { Action, AnyAction, Dispatch } from 'redux' | ||
import { Context } from 'react' | ||
import type { Action, AnyAction, Dispatch } from 'redux' | ||
import type { Context } from 'react' | ||
import { | ||
ReactReduxContext, | ||
ReactReduxContextValue, | ||
} from '../components/Context' | ||
import type { ReactReduxContextValue } from '../components/Context' | ||
import { ReactReduxContext } from '../components/Context' | ||
import { useStore as useDefaultStore, createStoreHook } from './useStore' | ||
@@ -9,0 +7,0 @@ |
@@ -6,2 +6,23 @@ import { useContext } from 'react' | ||
/** | ||
* Hook factory, which creates a `useReduxContext` hook bound to a given context. This is a low-level | ||
* hook that you should usually not need to call directly. | ||
* | ||
* @param {React.Context} [context=ReactReduxContext] Context passed to your `<Provider>`. | ||
* @returns {Function} A `useReduxContext` hook bound to the specified context. | ||
*/ | ||
export function createReduxContextHook(context = ReactReduxContext) { | ||
return function useReduxContext(): ReactReduxContextValue | null { | ||
const contextValue = useContext(context) | ||
if (process.env.NODE_ENV !== 'production' && !contextValue) { | ||
throw new Error( | ||
'could not find react-redux context value; please ensure the component is wrapped in a <Provider>' | ||
) | ||
} | ||
return contextValue | ||
} | ||
} | ||
/** | ||
* A hook to access the value of the `ReactReduxContext`. This is a low-level | ||
@@ -22,12 +43,2 @@ * hook that you should usually not need to call directly. | ||
*/ | ||
export function useReduxContext(): ReactReduxContextValue | null { | ||
const contextValue = useContext(ReactReduxContext) | ||
if (process.env.NODE_ENV !== 'production' && !contextValue) { | ||
throw new Error( | ||
'could not find react-redux context value; please ensure the component is wrapped in a <Provider>' | ||
) | ||
} | ||
return contextValue | ||
} | ||
export const useReduxContext = /*#__PURE__*/ createReduxContextHook() |
@@ -1,4 +0,7 @@ | ||
import { useContext, useDebugValue } from 'react' | ||
import { useCallback, useDebugValue, useRef } from 'react' | ||
import { useReduxContext as useDefaultReduxContext } from './useReduxContext' | ||
import { | ||
createReduxContextHook, | ||
useReduxContext as useDefaultReduxContext, | ||
} from './useReduxContext' | ||
import { ReactReduxContext } from '../components/Context' | ||
@@ -9,2 +12,21 @@ import type { EqualityFn, NoInfer } from '../types' | ||
export type CheckFrequency = 'never' | 'once' | 'always' | ||
export interface UseSelectorOptions<Selected = unknown> { | ||
equalityFn?: EqualityFn<Selected> | ||
stabilityCheck?: CheckFrequency | ||
noopCheck?: CheckFrequency | ||
} | ||
interface UseSelector { | ||
<TState = unknown, Selected = unknown>( | ||
selector: (state: TState) => Selected, | ||
equalityFn?: EqualityFn<Selected> | ||
): Selected | ||
<TState = unknown, Selected = unknown>( | ||
selector: (state: TState) => Selected, | ||
options?: UseSelectorOptions<Selected> | ||
): Selected | ||
} | ||
let useSyncExternalStoreWithSelector = notInitialized as uSESWS | ||
@@ -23,17 +45,21 @@ export const initializeUseSelector = (fn: uSESWS) => { | ||
*/ | ||
export function createSelectorHook( | ||
context = ReactReduxContext | ||
): <TState = unknown, Selected = unknown>( | ||
selector: (state: TState) => Selected, | ||
equalityFn?: EqualityFn<Selected> | ||
) => Selected { | ||
export function createSelectorHook(context = ReactReduxContext): UseSelector { | ||
const useReduxContext = | ||
context === ReactReduxContext | ||
? useDefaultReduxContext | ||
: () => useContext(context) | ||
: createReduxContextHook(context) | ||
return function useSelector<TState, Selected extends unknown>( | ||
selector: (state: TState) => Selected, | ||
equalityFn: EqualityFn<NoInfer<Selected>> = refEquality | ||
equalityFnOrOptions: | ||
| EqualityFn<NoInfer<Selected>> | ||
| UseSelectorOptions<NoInfer<Selected>> = {} | ||
): Selected { | ||
const { | ||
equalityFn = refEquality, | ||
stabilityCheck = undefined, | ||
noopCheck = undefined, | ||
} = typeof equalityFnOrOptions === 'function' | ||
? { equalityFn: equalityFnOrOptions } | ||
: equalityFnOrOptions | ||
if (process.env.NODE_ENV !== 'production') { | ||
@@ -53,4 +79,64 @@ if (!selector) { | ||
const { store, subscription, getServerState } = useReduxContext()! | ||
const { | ||
store, | ||
subscription, | ||
getServerState, | ||
stabilityCheck: globalStabilityCheck, | ||
noopCheck: globalNoopCheck, | ||
} = useReduxContext()! | ||
const firstRun = useRef(true) | ||
const wrappedSelector = useCallback<typeof selector>( | ||
{ | ||
[selector.name](state: TState) { | ||
const selected = selector(state) | ||
if (process.env.NODE_ENV !== 'production') { | ||
const finalStabilityCheck = | ||
typeof stabilityCheck === 'undefined' | ||
? globalStabilityCheck | ||
: stabilityCheck | ||
if ( | ||
finalStabilityCheck === 'always' || | ||
(finalStabilityCheck === 'once' && firstRun.current) | ||
) { | ||
const toCompare = selector(state) | ||
if (!equalityFn(selected, toCompare)) { | ||
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, | ||
} | ||
) | ||
} | ||
} | ||
const finalNoopCheck = | ||
typeof noopCheck === 'undefined' ? globalNoopCheck : noopCheck | ||
if ( | ||
finalNoopCheck === 'always' || | ||
(finalNoopCheck === 'once' && firstRun.current) | ||
) { | ||
// @ts-ignore | ||
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.' | ||
) | ||
} | ||
} | ||
if (firstRun.current) firstRun.current = false | ||
} | ||
return selected | ||
}, | ||
}[selector.name], | ||
[selector, globalStabilityCheck, stabilityCheck] | ||
) | ||
const selectedState = useSyncExternalStoreWithSelector( | ||
@@ -60,3 +146,3 @@ subscription.addNestedSub, | ||
getServerState || store.getState, | ||
selector, | ||
wrappedSelector, | ||
equalityFn | ||
@@ -63,0 +149,0 @@ ) |
@@ -1,8 +0,9 @@ | ||
import { useContext, Context } from 'react' | ||
import { Action as BasicAction, AnyAction, Store } from 'redux' | ||
import type { Context } from 'react' | ||
import type { Action as BasicAction, AnyAction, Store } from 'redux' | ||
import type { ReactReduxContextValue } from '../components/Context' | ||
import { ReactReduxContext } from '../components/Context' | ||
import { | ||
ReactReduxContext, | ||
ReactReduxContextValue, | ||
} from '../components/Context' | ||
import { useReduxContext as useDefaultReduxContext } from './useReduxContext' | ||
useReduxContext as useDefaultReduxContext, | ||
createReduxContextHook, | ||
} from './useReduxContext' | ||
@@ -24,3 +25,4 @@ /** | ||
? useDefaultReduxContext | ||
: () => useContext(context) | ||
: // @ts-ignore | ||
createReduxContextHook(context) | ||
return function useStore< | ||
@@ -27,0 +29,0 @@ State = S, |
@@ -1,2 +0,2 @@ | ||
import { | ||
import type { | ||
ClassAttributes, | ||
@@ -8,3 +8,3 @@ ComponentClass, | ||
import { Action, AnyAction, Dispatch } from 'redux' | ||
import type { Action, AnyAction, Dispatch } from 'redux' | ||
@@ -15,2 +15,4 @@ import type { NonReactStatics } from 'hoist-non-react-statics' | ||
import type { UseSelectorOptions } from './hooks/useSelector' | ||
export type FixTypeLater = any | ||
@@ -172,4 +174,8 @@ | ||
): TSelected | ||
<Selected = unknown>( | ||
selector: (state: TState) => Selected, | ||
options?: UseSelectorOptions<Selected> | ||
): Selected | ||
} | ||
export type NoInfer<T> = [T][T extends any ? 0 : never] |
@@ -1,2 +0,2 @@ | ||
import { ActionCreatorsMapObject, Dispatch } from 'redux' | ||
import type { ActionCreatorsMapObject, Dispatch } from 'redux' | ||
@@ -3,0 +3,0 @@ export default function bindActionCreators( |
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
330529
6892
21