react-redux
Advanced tools
Comparing version 8.1.1 to 8.1.2
@@ -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,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,O=Symbol.for("react-redux-context-"+t.version),C=globalThis;const E=new Proxy({},new Proxy({},{get(e,n){const r=function(){let e=C[O];return e||(e=t.createContext(null),C[O]=e),e}();return(e,...t)=>Reflect[n](r,...t)}}));function M(e=E){return function(){return t.useContext(e)}}const j=M(),R=()=>{throw Error("uSES not initialized!")};let T=R;const q=(e,t)=>e===t;function N(e=E){const n=e===E?j:M(e);return function(e,r={}){const{equalityFn:o=q,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=T(s.addNestedSub,c.getState,a||c.getState,f,o);return t.useDebugValue(l),l}}const k=N();function F(){return(F=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 D(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} | ||
!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} | ||
/** @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 _="function"==typeof Symbol&&Symbol.for,L=_?Symbol.for("react.element"):60103,V=_?Symbol.for("react.portal"):60106,z=_?Symbol.for("react.fragment"):60107,W=_?Symbol.for("react.strict_mode"):60108,U=_?Symbol.for("react.profiler"):60114,H=_?Symbol.for("react.provider"):60109,A=_?Symbol.for("react.context"):60110,I=_?Symbol.for("react.async_mode"):60111,B=_?Symbol.for("react.concurrent_mode"):60111,G=_?Symbol.for("react.forward_ref"):60112,J=_?Symbol.for("react.suspense"):60113,K=_?Symbol.for("react.suspense_list"):60120,Q=_?Symbol.for("react.memo"):60115,X=_?Symbol.for("react.lazy"):60116,Y=_?Symbol.for("react.block"):60121,Z=_?Symbol.for("react.fundamental"):60117,ee=_?Symbol.for("react.responder"):60118,te=_?Symbol.for("react.scope"):60119;function ne(e){if("object"==typeof e&&null!==e){var t=e.$$typeof;switch(t){case L:switch(e=e.type){case I:case B:case z:case U:case W:case J:return e;default:switch(e=e&&e.$$typeof){case A:case G:case X:case Q:case H:return e;default:return t}}case V:return t}}}function re(e){return ne(e)===B}var oe={AsyncMode:I,ConcurrentMode:B,ContextConsumer:A,ContextProvider:H,Element:L,ForwardRef:G,Fragment:z,Lazy:X,Memo:Q,Portal:V,Profiler:U,StrictMode:W,Suspense:J,isAsyncMode:function(e){return re(e)||ne(e)===I},isConcurrentMode:re,isContextConsumer:function(e){return ne(e)===A},isContextProvider:function(e){return ne(e)===H},isElement:function(e){return"object"==typeof e&&null!==e&&e.$$typeof===L},isForwardRef:function(e){return ne(e)===G},isFragment:function(e){return ne(e)===z},isLazy:function(e){return ne(e)===X},isMemo:function(e){return ne(e)===Q},isPortal:function(e){return ne(e)===V},isProfiler:function(e){return ne(e)===U},isStrictMode:function(e){return ne(e)===W},isSuspense:function(e){return ne(e)===J},isValidElementType:function(e){return"string"==typeof e||"function"==typeof e||e===z||e===B||e===U||e===W||e===J||e===K||"object"==typeof e&&null!==e&&(e.$$typeof===X||e.$$typeof===Q||e.$$typeof===H||e.$$typeof===A||e.$$typeof===G||e.$$typeof===Z||e.$$typeof===ee||e.$$typeof===te||e.$$typeof===Y)},typeOf:ne},ue=u((function(e){e.exports=oe})),ce={childContextTypes:!0,contextType:!0,contextTypes:!0,defaultProps:!0,displayName:!0,getDefaultProps:!0,getDerivedStateFromError:!0,getDerivedStateFromProps:!0,mixins:!0,propTypes:!0,type:!0},se={name:!0,length:!0,prototype:!0,caller:!0,callee:!0,arguments:!0,arity:!0},ae={$$typeof:!0,compare:!0,defaultProps:!0,displayName:!0,propTypes:!0,type:!0},ie={};function fe(e){return ue.isMemo(e)?ae:ie[e.$$typeof]||ce}ie[ue.ForwardRef]={$$typeof:!0,render:!0,defaultProps:!0,displayName:!0,propTypes:!0},ie[ue.Memo]=ae;var le=Object.defineProperty,pe=Object.getOwnPropertyNames,de=Object.getOwnPropertySymbols,ye=Object.getOwnPropertyDescriptor,me=Object.getPrototypeOf,be=Object.prototype;var Se=function e(t,n,r){if("string"!=typeof n){if(be){var o=me(n);o&&o!==be&&e(t,o,r)}var u=pe(n);de&&(u=u.concat(de(n)));for(var c=fe(t),s=fe(n),a=0;u.length>a;++a){var i=u[a];if(!(se[i]||r&&r[i]||s&&s[i]||c&&c[i])){var f=ye(n,i);try{le(t,i,f)}catch(e){}}}}return t},ve=Symbol.for("react.element"),he=Symbol.for("react.portal"),ge=Symbol.for("react.fragment"),Pe=Symbol.for("react.strict_mode"),we=Symbol.for("react.profiler"),xe=Symbol.for("react.provider"),$e=Symbol.for("react.context"),Oe=Symbol.for("react.server_context"),Ce=Symbol.for("react.forward_ref"),Ee=Symbol.for("react.suspense"),Me=Symbol.for("react.suspense_list"),je=Symbol.for("react.memo"),Re=Symbol.for("react.lazy"),Te=Symbol.for("react.offscreen"),qe=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,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"); | ||
/** | ||
@@ -19,2 +19,2 @@ * @license React | ||
* LICENSE file in the root directory of this source tree. | ||
*/function Ne(e){if("object"==typeof e&&null!==e){var t=e.$$typeof;switch(t){case ve:switch(e=e.type){case ge:case we:case Pe:case Ee:case Me:return e;default:switch(e=e&&e.$$typeof){case Oe:case $e:case Ce:case Re:case je:case xe:return e;default:return t}}case he:return t}}}var ke={ContextConsumer:$e,ContextProvider:xe,Element:ve,ForwardRef:Ce,Fragment:ge,Lazy:Re,Memo:je,Portal:he,Profiler:we,StrictMode:Pe,Suspense:Ee,SuspenseList:Me,isAsyncMode:function(){return!1},isConcurrentMode:function(){return!1},isContextConsumer:function(e){return Ne(e)===$e},isContextProvider:function(e){return Ne(e)===xe},isElement:function(e){return"object"==typeof e&&null!==e&&e.$$typeof===ve},isForwardRef:function(e){return Ne(e)===Ce},isFragment:function(e){return Ne(e)===ge},isLazy:function(e){return Ne(e)===Re},isMemo:function(e){return Ne(e)===je},isPortal:function(e){return Ne(e)===he},isProfiler:function(e){return Ne(e)===we},isStrictMode:function(e){return Ne(e)===Pe},isSuspense:function(e){return Ne(e)===Ee},isSuspenseList:function(e){return Ne(e)===Me},isValidElementType:function(e){return"string"==typeof e||"function"==typeof e||e===ge||e===we||e===Pe||e===Ee||e===Me||e===Te||"object"==typeof e&&null!==e&&(e.$$typeof===Re||e.$$typeof===je||e.$$typeof===xe||e.$$typeof===$e||e.$$typeof===Ce||e.$$typeof===qe||void 0!==e.getModuleId)},typeOf:Ne},Fe=u((function(e){e.exports=ke}));const De=["initMapStateToProps","initMapDispatchToProps","initMergeProps"];function _e(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 Le(e){return function(t){const n=e(t);function r(){return n}return r.dependsOnOwnProps=!1,r}}function Ve(e){return e.dependsOnOwnProps?!!e.dependsOnOwnProps:1!==e.length}function ze(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=Ve(e);let o=n(t,r);return"function"==typeof o&&(n.mapToProps=o,n.dependsOnOwnProps=Ve(o),o=n(t,r)),o},n}}function We(e,t){return(n,r)=>{throw Error(`Invalid value of type ${typeof e} for ${t} argument when connecting component ${r.wrappedComponentName}.`)}}function Ue(e,t,n){return F({},n,e,t)}const He={notify(){},get:()=>[]};function Ae(e,t){let n,r=He;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=He)},getListeners:()=>r};return c}const Ie=!("undefined"==typeof window||void 0===window.document||void 0===window.document.createElement)?t.useLayoutEffect:t.useEffect;function Be(e,t){return e===t?0!==e||0!==t||1/e==1/t:e!=e&&t!=t}function Ge(e,t){if(Be(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])||!Be(e[n[r]],t[n[r]]))return!1;return!0}const Je=["reactReduxForwardedRef"];let Ke=R;const Qe=[null,null];function Xe(e,t,n,r,o,u){e.current=r,n.current=!1,o.current&&(o.current=null,u())}function Ye(e,t){return e===t}function Ze(e=E){const t=e===E?j:M(e);return function(){const{store:e}=t();return e}}const et=Ze();function tt(e=E){const t=e===E?et:Ze(e);return function(){return t().dispatch}}const nt=tt();T=w.useSyncExternalStoreWithSelector,(e=>{Ke=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=Ae(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 Ie((()=>{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||E).Provider,{value:a},r)},e.ReactReduxContext=E,e.connect=function(e,n,r,{areStatesEqual:u=Ye,areOwnPropsEqual:c=Ge,areStatePropsEqual:s=Ge,areMergedPropsEqual:a=Ge,forwardRef:i=!1,context:f=E}={}){const l=f,p=function(e){return e?"function"==typeof e?ze(e):We(e,"mapStateToProps"):Le((()=>({})))}(e),d=function(e){return e&&"object"==typeof e?Le((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?ze(e):We(e,"mapDispatchToProps"):Le((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):We(e,"mergeProps"):()=>Ue}(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=D(n,Je);return[n.context,e,t]}),[n]),s=t.useMemo((()=>r&&r.Consumer&&Fe.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=D(t,De);return _e(n(e,u),r(e,u),o(e,u),e,u)}(p.dispatch,f)),[p]),[b,S]=t.useMemo((()=>{if(!m)return Qe;const e=Ae(p,i?void 0:a.subscription),t=e.notifyNestedSubs.bind(e);return[e,t]}),[p,i,a]),v=t.useMemo((()=>i?a:F({},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();Ie((()=>(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=Xe,M=[g,h,w,c,P,S],Ie((()=>E(...M)),j);try{R=Ke(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}Ie((()=>{$.current=void 0,P.current=void 0,h.current=R}));const T=t.useMemo((()=>o.default.createElement(e,F({},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,F({},e,{reactReduxForwardedRef:t}))}));return t.displayName=r,t.WrappedComponent=e,Se(t,e)}return Se(S,e)}},e.createDispatchHook=tt,e.createSelectorHook=N,e.createStoreHook=Ze,e.shallowEqual=Ge,e.useDispatch=nt,e.useSelector=k,e.useStore=et,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,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})})); |
declare const batch: (callback: () => void) => void; | ||
export { batch }; | ||
export * from './exports'; |
@@ -0,0 +0,0 @@ import type { Store } from 'redux'; |
@@ -7,3 +7,3 @@ import _extends from "@babel/runtime/helpers/esm/extends"; | ||
import hoistStatics from 'hoist-non-react-statics'; | ||
import React, { useContext, useMemo, useRef } from 'react'; | ||
import * as React from 'react'; | ||
import { isValidElementType, isContextConsumer } from 'react-is'; | ||
@@ -219,3 +219,3 @@ import defaultSelectorFactory from '../connect/selectorFactory'; | ||
function ConnectFunction(props) { | ||
const [propsContext, reactReduxForwardedRef, wrapperProps] = useMemo(() => { | ||
const [propsContext, reactReduxForwardedRef, wrapperProps] = React.useMemo(() => { | ||
// Distinguish between actual "data" props that were passed to the wrapper component, | ||
@@ -231,3 +231,3 @@ // and values needed to control behavior (forwarded refs, alternate context instances). | ||
}, [props]); | ||
const ContextToUse = useMemo(() => { | ||
const ContextToUse = React.useMemo(() => { | ||
// Users may optionally pass in a custom context instance to use instead of our ReactReduxContext. | ||
@@ -239,3 +239,3 @@ // Memoize the check that determines which context instance we should use. | ||
const contextValue = useContext(ContextToUse); // The store _must_ exist as either a prop or in context. | ||
const contextValue = React.useContext(ContextToUse); // The store _must_ exist as either a prop or in context. | ||
// We'll check to see if it _looks_ like a Redux store first. | ||
@@ -254,3 +254,3 @@ // This allows us to pass through a `store` prop that is just a plain value. | ||
const getServerState = didStoreComeFromContext ? contextValue.getServerState : store.getState; | ||
const childPropsSelector = useMemo(() => { | ||
const childPropsSelector = React.useMemo(() => { | ||
// The child props selector needs the store reference as an input. | ||
@@ -260,3 +260,3 @@ // Re-create this selector whenever the store changes. | ||
}, [store]); | ||
const [subscription, notifyNestedSubs] = useMemo(() => { | ||
const [subscription, notifyNestedSubs] = React.useMemo(() => { | ||
if (!shouldHandleStateChanges) return NO_SUBSCRIPTION_ARRAY; // This Subscription's source should match where store came from: props vs. context. A component | ||
@@ -275,3 +275,3 @@ // connected to the store via props shouldn't use subscription from context, or vice versa. | ||
const overriddenContextValue = useMemo(() => { | ||
const overriddenContextValue = React.useMemo(() => { | ||
if (didStoreComeFromProps) { | ||
@@ -291,9 +291,9 @@ // This component is directly subscribed to a store from props. | ||
const lastChildProps = useRef(); | ||
const lastWrapperProps = useRef(wrapperProps); | ||
const childPropsFromStoreUpdate = useRef(); | ||
const renderIsScheduled = useRef(false); | ||
const isProcessingDispatch = useRef(false); | ||
const isMounted = useRef(false); | ||
const latestSubscriptionCallbackError = useRef(); | ||
const lastChildProps = React.useRef(); | ||
const lastWrapperProps = React.useRef(wrapperProps); | ||
const childPropsFromStoreUpdate = React.useRef(); | ||
const renderIsScheduled = React.useRef(false); | ||
const isProcessingDispatch = React.useRef(false); | ||
const isMounted = React.useRef(false); | ||
const latestSubscriptionCallbackError = React.useRef(); | ||
useIsomorphicLayoutEffect(() => { | ||
@@ -305,3 +305,3 @@ isMounted.current = true; | ||
}, []); | ||
const actualChildPropsSelector = useMemo(() => { | ||
const actualChildPropsSelector = React.useMemo(() => { | ||
const selector = () => { | ||
@@ -330,3 +330,3 @@ // Tricky logic here: | ||
const subscribeForReact = useMemo(() => { | ||
const subscribeForReact = React.useMemo(() => { | ||
const subscribe = reactListener => { | ||
@@ -367,3 +367,3 @@ if (!subscription) { | ||
const renderedWrappedComponent = useMemo(() => { | ||
const renderedWrappedComponent = React.useMemo(() => { | ||
return ( | ||
@@ -379,3 +379,3 @@ /*#__PURE__*/ | ||
const renderedChild = useMemo(() => { | ||
const renderedChild = React.useMemo(() => { | ||
if (shouldHandleStateChanges) { | ||
@@ -382,0 +382,0 @@ // If this component is subscribed to store updates, we need to pass its own |
@@ -1,2 +0,2 @@ | ||
import type { Context } from 'react'; | ||
import * as React from 'react'; | ||
import type { Action, AnyAction, Store } from 'redux'; | ||
@@ -12,4 +12,4 @@ import type { Subscription } from '../utils/Subscription'; | ||
} | ||
export declare const ReactReduxContext: Context<ReactReduxContextValue<any, AnyAction>>; | ||
export declare const ReactReduxContext: React.Context<ReactReduxContextValue<any, AnyAction>>; | ||
export declare type ReactReduxContextInstance = typeof ReactReduxContext; | ||
export default ReactReduxContext; |
@@ -1,10 +0,16 @@ | ||
import { createContext, version as ReactVersion } from 'react'; | ||
const ContextKey = Symbol.for(`react-redux-context-${ReactVersion}`); | ||
const gT = globalThis; | ||
import * as React from 'react'; | ||
const ContextKey = Symbol.for(`react-redux-context`); | ||
const gT = typeof globalThis !== "undefined" ? globalThis : | ||
/* fall back to a per-module scope (pre-8.1 behaviour) if `globalThis` is not available */ | ||
{}; | ||
function getContext() { | ||
let realContext = gT[ContextKey]; | ||
var _gT$ContextKey; | ||
if (!React.createContext) return {}; | ||
const contextMap = (_gT$ContextKey = gT[ContextKey]) != null ? _gT$ContextKey : gT[ContextKey] = new Map(); | ||
let realContext = contextMap.get(React.createContext); | ||
if (!realContext) { | ||
realContext = createContext(null); | ||
realContext = React.createContext(null); | ||
@@ -15,3 +21,3 @@ if (process.env.NODE_ENV !== 'production') { | ||
gT[ContextKey] = realContext; | ||
contextMap.set(React.createContext, realContext); | ||
} | ||
@@ -22,10 +28,3 @@ | ||
export const ReactReduxContext = /*#__PURE__*/new Proxy({}, /*#__PURE__*/new Proxy({}, { | ||
get(_, handler) { | ||
const target = getContext(); // @ts-ignore | ||
return (_target, ...args) => Reflect[handler](target, ...args); | ||
} | ||
})); | ||
export const ReactReduxContext = /*#__PURE__*/getContext(); | ||
export default ReactReduxContext; |
@@ -0,0 +0,0 @@ import type { Context, ReactNode } from 'react'; |
@@ -1,2 +0,2 @@ | ||
import React, { useMemo } from 'react'; | ||
import * as React from 'react'; | ||
import { ReactReduxContext } from './Context'; | ||
@@ -14,3 +14,3 @@ import { createSubscription } from '../utils/Subscription'; | ||
}) { | ||
const contextValue = useMemo(() => { | ||
const contextValue = React.useMemo(() => { | ||
const subscription = createSubscription(store); | ||
@@ -25,3 +25,3 @@ return { | ||
}, [store, serverState, stabilityCheck, noopCheck]); | ||
const previousState = useMemo(() => store.getState(), [store]); | ||
const previousState = React.useMemo(() => store.getState(), [store]); | ||
useIsomorphicLayoutEffect(() => { | ||
@@ -28,0 +28,0 @@ const { |
@@ -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" /> |
@@ -0,0 +0,0 @@ import { useCallback, useDebugValue, useRef } from 'react'; |
@@ -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'; |
@@ -5,3 +5,3 @@ // The secondary entry point assumes we are working with React 18, and thus have | ||
// non-shim version. This shaves off the byte size of the shim. | ||
import { useSyncExternalStore } from 'react'; | ||
import * as React from 'react'; | ||
import { useSyncExternalStoreWithSelector } from 'use-sync-external-store/with-selector'; | ||
@@ -13,3 +13,3 @@ import { unstable_batchedUpdates as batch } from './utils/reactBatchedUpdates'; | ||
initializeUseSelector(useSyncExternalStoreWithSelector); | ||
initializeConnect(useSyncExternalStore); // Enable batched updates in our subscriptions for use | ||
initializeConnect(React.useSyncExternalStore); // Enable batched updates in our subscriptions for use | ||
// with standard React renderers (ReactDOM, React Native) | ||
@@ -16,0 +16,0 @@ |
@@ -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; |
@@ -1,3 +0,3 @@ | ||
import { useLayoutEffect } from 'react'; | ||
import * as React from 'react'; | ||
export declare const canUseDOM: boolean; | ||
export declare const useIsomorphicLayoutEffect: typeof useLayoutEffect; | ||
export declare const useIsomorphicLayoutEffect: typeof React.useLayoutEffect; |
@@ -1,2 +0,2 @@ | ||
import { useEffect, useLayoutEffect } from 'react'; // React currently throws a warning when using useLayoutEffect on the server. | ||
import * as React from 'react'; // React currently throws a warning when using useLayoutEffect on the server. | ||
// To get around it, we can conditionally useEffect on the server (no-op) and | ||
@@ -12,2 +12,2 @@ // useLayoutEffect in the browser. We need useLayoutEffect to ensure the store | ||
export const canUseDOM = !!(typeof window !== 'undefined' && typeof window.document !== 'undefined' && typeof window.document.createElement !== 'undefined'); | ||
export const useIsomorphicLayoutEffect = canUseDOM ? useLayoutEffect : useEffect; | ||
export const useIsomorphicLayoutEffect = canUseDOM ? React.useLayoutEffect : React.useEffect; |
@@ -1,2 +0,2 @@ | ||
import { useLayoutEffect } from 'react'; | ||
export declare const useIsomorphicLayoutEffect: typeof useLayoutEffect; | ||
import * as React from 'react'; | ||
export declare const useIsomorphicLayoutEffect: typeof React.useLayoutEffect; |
@@ -1,3 +0,3 @@ | ||
import { useLayoutEffect } from 'react'; // Under React Native, we know that we always want to use useLayoutEffect | ||
import * as React from 'react'; // Under React Native, we know that we always want to use useLayoutEffect | ||
export const useIsomorphicLayoutEffect = useLayoutEffect; | ||
export const useIsomorphicLayoutEffect = 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 @@ /** |
@@ -14,3 +14,3 @@ "use strict"; | ||
var _react = _interopRequireWildcard(require("react")); | ||
var React = _interopRequireWildcard(require("react")); | ||
@@ -247,3 +247,3 @@ var _reactIs = require("react-is"); | ||
function ConnectFunction(props) { | ||
const [propsContext, reactReduxForwardedRef, wrapperProps] = (0, _react.useMemo)(() => { | ||
const [propsContext, reactReduxForwardedRef, wrapperProps] = React.useMemo(() => { | ||
// Distinguish between actual "data" props that were passed to the wrapper component, | ||
@@ -258,10 +258,10 @@ // and values needed to control behavior (forwarded refs, alternate context instances). | ||
}, [props]); | ||
const ContextToUse = (0, _react.useMemo)(() => { | ||
const ContextToUse = React.useMemo(() => { | ||
// Users may optionally pass in a custom context instance to use instead of our ReactReduxContext. | ||
// Memoize the check that determines which context instance we should use. | ||
return propsContext && propsContext.Consumer && // @ts-ignore | ||
(0, _reactIs.isContextConsumer)( /*#__PURE__*/_react.default.createElement(propsContext.Consumer, null)) ? propsContext : Context; | ||
(0, _reactIs.isContextConsumer)( /*#__PURE__*/React.createElement(propsContext.Consumer, null)) ? propsContext : Context; | ||
}, [propsContext, Context]); // Retrieve the store and ancestor subscription via context, if available | ||
const contextValue = (0, _react.useContext)(ContextToUse); // The store _must_ exist as either a prop or in context. | ||
const contextValue = React.useContext(ContextToUse); // The store _must_ exist as either a prop or in context. | ||
// We'll check to see if it _looks_ like a Redux store first. | ||
@@ -280,3 +280,3 @@ // This allows us to pass through a `store` prop that is just a plain value. | ||
const getServerState = didStoreComeFromContext ? contextValue.getServerState : store.getState; | ||
const childPropsSelector = (0, _react.useMemo)(() => { | ||
const childPropsSelector = React.useMemo(() => { | ||
// The child props selector needs the store reference as an input. | ||
@@ -286,3 +286,3 @@ // Re-create this selector whenever the store changes. | ||
}, [store]); | ||
const [subscription, notifyNestedSubs] = (0, _react.useMemo)(() => { | ||
const [subscription, notifyNestedSubs] = React.useMemo(() => { | ||
if (!shouldHandleStateChanges) return NO_SUBSCRIPTION_ARRAY; // This Subscription's source should match where store came from: props vs. context. A component | ||
@@ -301,3 +301,3 @@ // connected to the store via props shouldn't use subscription from context, or vice versa. | ||
const overriddenContextValue = (0, _react.useMemo)(() => { | ||
const overriddenContextValue = React.useMemo(() => { | ||
if (didStoreComeFromProps) { | ||
@@ -317,9 +317,9 @@ // This component is directly subscribed to a store from props. | ||
const lastChildProps = (0, _react.useRef)(); | ||
const lastWrapperProps = (0, _react.useRef)(wrapperProps); | ||
const childPropsFromStoreUpdate = (0, _react.useRef)(); | ||
const renderIsScheduled = (0, _react.useRef)(false); | ||
const isProcessingDispatch = (0, _react.useRef)(false); | ||
const isMounted = (0, _react.useRef)(false); | ||
const latestSubscriptionCallbackError = (0, _react.useRef)(); | ||
const lastChildProps = React.useRef(); | ||
const lastWrapperProps = React.useRef(wrapperProps); | ||
const childPropsFromStoreUpdate = React.useRef(); | ||
const renderIsScheduled = React.useRef(false); | ||
const isProcessingDispatch = React.useRef(false); | ||
const isMounted = React.useRef(false); | ||
const latestSubscriptionCallbackError = React.useRef(); | ||
(0, _useIsomorphicLayoutEffect.useIsomorphicLayoutEffect)(() => { | ||
@@ -331,3 +331,3 @@ isMounted.current = true; | ||
}, []); | ||
const actualChildPropsSelector = (0, _react.useMemo)(() => { | ||
const actualChildPropsSelector = React.useMemo(() => { | ||
const selector = () => { | ||
@@ -356,3 +356,3 @@ // Tricky logic here: | ||
const subscribeForReact = (0, _react.useMemo)(() => { | ||
const subscribeForReact = React.useMemo(() => { | ||
const subscribe = reactListener => { | ||
@@ -393,7 +393,7 @@ if (!subscription) { | ||
const renderedWrappedComponent = (0, _react.useMemo)(() => { | ||
const renderedWrappedComponent = React.useMemo(() => { | ||
return ( | ||
/*#__PURE__*/ | ||
// @ts-ignore | ||
_react.default.createElement(WrappedComponent, (0, _extends2.default)({}, actualChildProps, { | ||
React.createElement(WrappedComponent, (0, _extends2.default)({}, actualChildProps, { | ||
ref: reactReduxForwardedRef | ||
@@ -405,3 +405,3 @@ })) | ||
const renderedChild = (0, _react.useMemo)(() => { | ||
const renderedChild = React.useMemo(() => { | ||
if (shouldHandleStateChanges) { | ||
@@ -411,3 +411,3 @@ // If this component is subscribed to store updates, we need to pass its own | ||
// Context instance, and putting a different value into the context. | ||
return /*#__PURE__*/_react.default.createElement(ContextToUse.Provider, { | ||
return /*#__PURE__*/React.createElement(ContextToUse.Provider, { | ||
value: overriddenContextValue | ||
@@ -422,3 +422,3 @@ }, renderedWrappedComponent); | ||
const _Connect = _react.default.memo(ConnectFunction); | ||
const _Connect = React.memo(ConnectFunction); | ||
@@ -431,5 +431,5 @@ // Add a hacky cast to get the right output type | ||
if (forwardRef) { | ||
const _forwarded = _react.default.forwardRef(function forwardConnectRef(props, ref) { | ||
const _forwarded = React.forwardRef(function forwardConnectRef(props, ref) { | ||
// @ts-ignore | ||
return /*#__PURE__*/_react.default.createElement(Connect, (0, _extends2.default)({}, props, { | ||
return /*#__PURE__*/React.createElement(Connect, (0, _extends2.default)({}, props, { | ||
reactReduxForwardedRef: ref | ||
@@ -436,0 +436,0 @@ })); |
@@ -6,12 +6,22 @@ "use strict"; | ||
var _react = require("react"); | ||
var React = _interopRequireWildcard(require("react")); | ||
const ContextKey = Symbol.for(`react-redux-context-${_react.version}`); | ||
const gT = globalThis; | ||
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); } | ||
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; } | ||
const ContextKey = Symbol.for(`react-redux-context`); | ||
const gT = typeof globalThis !== "undefined" ? globalThis : | ||
/* fall back to a per-module scope (pre-8.1 behaviour) if `globalThis` is not available */ | ||
{}; | ||
function getContext() { | ||
let realContext = gT[ContextKey]; | ||
var _gT$ContextKey; | ||
if (!React.createContext) return {}; | ||
const contextMap = (_gT$ContextKey = gT[ContextKey]) != null ? _gT$ContextKey : gT[ContextKey] = new Map(); | ||
let realContext = contextMap.get(React.createContext); | ||
if (!realContext) { | ||
realContext = (0, _react.createContext)(null); | ||
realContext = React.createContext(null); | ||
@@ -22,3 +32,3 @@ if (process.env.NODE_ENV !== 'production') { | ||
gT[ContextKey] = realContext; | ||
contextMap.set(React.createContext, realContext); | ||
} | ||
@@ -29,12 +39,5 @@ | ||
const ReactReduxContext = /*#__PURE__*/new Proxy({}, /*#__PURE__*/new Proxy({}, { | ||
get(_, handler) { | ||
const target = getContext(); // @ts-ignore | ||
return (_target, ...args) => Reflect[handler](target, ...args); | ||
} | ||
})); | ||
const ReactReduxContext = /*#__PURE__*/getContext(); | ||
exports.ReactReduxContext = ReactReduxContext; | ||
var _default = ReactReduxContext; | ||
exports.default = _default; |
@@ -6,3 +6,3 @@ "use strict"; | ||
var _react = _interopRequireWildcard(require("react")); | ||
var React = _interopRequireWildcard(require("react")); | ||
@@ -27,3 +27,3 @@ var _Context = require("./Context"); | ||
}) { | ||
const contextValue = (0, _react.useMemo)(() => { | ||
const contextValue = React.useMemo(() => { | ||
const subscription = (0, _Subscription.createSubscription)(store); | ||
@@ -38,3 +38,3 @@ return { | ||
}, [store, serverState, stabilityCheck, noopCheck]); | ||
const previousState = (0, _react.useMemo)(() => store.getState(), [store]); | ||
const previousState = React.useMemo(() => store.getState(), [store]); | ||
(0, _useIsomorphicLayoutEffect.useIsomorphicLayoutEffect)(() => { | ||
@@ -58,3 +58,3 @@ const { | ||
return /*#__PURE__*/_react.default.createElement(Context.Provider, { | ||
return /*#__PURE__*/React.createElement(Context.Provider, { | ||
value: contextValue | ||
@@ -61,0 +61,0 @@ }, children); |
@@ -0,0 +0,0 @@ "use strict"; |
@@ -0,0 +0,0 @@ "use strict"; |
@@ -0,0 +0,0 @@ "use strict"; |
@@ -0,0 +0,0 @@ "use strict"; |
@@ -14,3 +14,3 @@ "use strict"; | ||
var _react = require("react"); | ||
var React = _interopRequireWildcard(require("react")); | ||
@@ -40,2 +40,7 @@ var _withSelector = require("use-sync-external-store/with-selector"); | ||
}); | ||
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); } | ||
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; } | ||
// The secondary entry point assumes we are working with React 18, and thus have | ||
@@ -46,5 +51,5 @@ // useSyncExternalStore available. We can import that directly from React itself. | ||
(0, _useSelector.initializeUseSelector)(_withSelector.useSyncExternalStoreWithSelector); | ||
(0, _connect.initializeConnect)(_react.useSyncExternalStore); // Enable batched updates in our subscriptions for use | ||
(0, _connect.initializeConnect)(React.useSyncExternalStore); // Enable batched updates in our subscriptions for use | ||
// with standard React renderers (ReactDOM, React Native) | ||
(0, _batch.setBatch)(_reactBatchedUpdates.unstable_batchedUpdates); |
@@ -0,0 +0,0 @@ "use strict"; |
@@ -6,4 +6,8 @@ "use strict"; | ||
var _react = require("react"); | ||
var React = _interopRequireWildcard(require("react")); | ||
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); } | ||
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; } | ||
// React currently throws a warning when using useLayoutEffect on the server. | ||
@@ -20,3 +24,3 @@ // To get around it, we can conditionally useEffect on the server (no-op) and | ||
exports.canUseDOM = canUseDOM; | ||
const useIsomorphicLayoutEffect = canUseDOM ? _react.useLayoutEffect : _react.useEffect; | ||
const useIsomorphicLayoutEffect = canUseDOM ? React.useLayoutEffect : React.useEffect; | ||
exports.useIsomorphicLayoutEffect = useIsomorphicLayoutEffect; |
@@ -6,6 +6,10 @@ "use strict"; | ||
var _react = require("react"); | ||
var React = _interopRequireWildcard(require("react")); | ||
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); } | ||
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; } | ||
// Under React Native, we know that we always want to use useLayoutEffect | ||
const useIsomorphicLayoutEffect = _react.useLayoutEffect; | ||
const useIsomorphicLayoutEffect = React.useLayoutEffect; | ||
exports.useIsomorphicLayoutEffect = useIsomorphicLayoutEffect; |
@@ -0,0 +0,0 @@ "use strict"; |
@@ -0,0 +0,0 @@ The MIT License (MIT) |
{ | ||
"name": "react-redux", | ||
"version": "8.1.1", | ||
"version": "8.1.2", | ||
"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 |
@@ -1,2 +0,2 @@ | ||
import { createContext, version as ReactVersion } from 'react' | ||
import * as React from 'react' | ||
import type { Context } from 'react' | ||
@@ -18,13 +18,24 @@ import type { Action, AnyAction, Store } from 'redux' | ||
const ContextKey = Symbol.for(`react-redux-context-${ReactVersion}`) | ||
const gT = globalThis as { [ContextKey]?: Context<ReactReduxContextValue> } | ||
const ContextKey = Symbol.for(`react-redux-context`) | ||
const gT: { | ||
[ContextKey]?: Map< | ||
typeof React.createContext, | ||
Context<ReactReduxContextValue> | ||
> | ||
} = (typeof globalThis !== "undefined" ? globalThis : /* fall back to a per-module scope (pre-8.1 behaviour) if `globalThis` is not available */ {}) as any; | ||
function getContext() { | ||
let realContext = gT[ContextKey] | ||
function getContext(): Context<ReactReduxContextValue> { | ||
if (!React.createContext) return {} as any | ||
const contextMap = (gT[ContextKey] ??= new Map< | ||
typeof React.createContext, | ||
Context<ReactReduxContextValue> | ||
>()) | ||
let realContext = contextMap.get(React.createContext) | ||
if (!realContext) { | ||
realContext = createContext<ReactReduxContextValue>(null as any) | ||
realContext = React.createContext<ReactReduxContextValue>(null as any) | ||
if (process.env.NODE_ENV !== 'production') { | ||
realContext.displayName = 'ReactRedux' | ||
} | ||
gT[ContextKey] = realContext | ||
contextMap.set(React.createContext, realContext) | ||
} | ||
@@ -34,15 +45,3 @@ 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 const ReactReduxContext = /*#__PURE__*/ getContext() | ||
@@ -49,0 +48,0 @@ export type ReactReduxContextInstance = typeof ReactReduxContext |
@@ -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' |
@@ -0,0 +0,0 @@ import { useCallback, useDebugValue, useRef } from 'react' |
@@ -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 |
@@ -6,3 +6,3 @@ // The secondary entry point assumes we are working with React 18, and thus have | ||
import { useSyncExternalStore } from 'react' | ||
import * as React from 'react' | ||
import { useSyncExternalStoreWithSelector } from 'use-sync-external-store/with-selector' | ||
@@ -17,3 +17,3 @@ | ||
initializeUseSelector(useSyncExternalStoreWithSelector) | ||
initializeConnect(useSyncExternalStore) | ||
initializeConnect(React.useSyncExternalStore) | ||
@@ -20,0 +20,0 @@ // Enable batched updates in our subscriptions for use |
@@ -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) { |
@@ -0,0 +0,0 @@ import { getBatch } from './batch' |
@@ -1,5 +0,5 @@ | ||
import { useLayoutEffect } from 'react' | ||
import * as React from 'react' | ||
// Under React Native, we know that we always want to use useLayoutEffect | ||
export const useIsomorphicLayoutEffect = useLayoutEffect | ||
export const useIsomorphicLayoutEffect = React.useLayoutEffect |
@@ -1,2 +0,2 @@ | ||
import { useEffect, useLayoutEffect } from 'react' | ||
import * as React from 'react' | ||
@@ -19,2 +19,4 @@ // React currently throws a warning when using useLayoutEffect on the server. | ||
export const useIsomorphicLayoutEffect = canUseDOM ? useLayoutEffect : useEffect | ||
export const useIsomorphicLayoutEffect = canUseDOM | ||
? React.useLayoutEffect | ||
: React.useEffect |
@@ -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
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
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
333651
6944
1