@acemarke/react-redux
Advanced tools
Comparing version 7.0.0-alpha.3 to 7.0.0-alpha.4
@@ -1,1 +0,1 @@ | ||
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("react-dom"),require("react"),require("redux")):"function"==typeof define&&define.amd?define(["exports","react-dom","react","redux"],t):t(e.ReactRedux={},e.ReactDOM,e.React,e.Redux)}(this,function(e,o,M,r){"use strict";var E="default"in M?M.default:M;function t(e,t){return e(t={exports:{}},t.exports),t.exports}function n(){}function i(){}i.resetWarningCache=n;var s=t(function(e){e.exports=function(){function e(e,t,r,n,o,i){if("SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"!==i){var s=Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw s.name="Invariant Violation",s}}function t(){return e}var r={array:e.isRequired=e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,elementType:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t,checkPropTypes:i,resetWarningCache:n};return r.PropTypes=r}()}),b=E.createContext(null),u=null,a={notify:function(){}};var T=function(){function e(e,t){this.store=e,this.parentSub=t,this.unsubscribe=null,this.listeners=a,this.handleChangeWrapper=this.handleChangeWrapper.bind(this)}var t=e.prototype;return t.addNestedSub=function(e){return this.trySubscribe(),this.listeners.subscribe(e)},t.notifyNestedSubs=function(){this.listeners.notify()},t.handleChangeWrapper=function(){this.onStateChange&&this.onStateChange()},t.isSubscribed=function(){return!!this.unsubscribe},t.trySubscribe=function(){var r,n;this.unsubscribe||(this.unsubscribe=this.parentSub?this.parentSub.addNestedSub(this.handleChangeWrapper):this.store.subscribe(this.handleChangeWrapper),this.listeners=(r=[],n=[],{clear:function(){r=n=u},notify:function(){var t=r=n;o.unstable_batchedUpdates(function(){for(var e=0;e<t.length;e++)t[e]()})},get:function(){return n},subscribe:function(e){var t=!0;return n===r&&(n=r.slice()),n.push(e),function(){t&&r!==u&&(t=!1,n===r&&(n=r.slice()),n.splice(n.indexOf(e),1))}}}))},t.tryUnsubscribe=function(){this.unsubscribe&&(this.unsubscribe(),this.unsubscribe=null,this.listeners.clear(),this.listeners=a)},e}(),c=function(o){var e,t;function r(e){var t;t=o.call(this,e)||this;var r=e.store;t.notifySubscribers=t.notifySubscribers.bind(function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(t));var n=new T(r);return n.onStateChange=t.notifySubscribers,t.state={store:r,subscription:n},t.previousState=r.getState(),t}(e=r).prototype=Object.create((t=o).prototype),(e.prototype.constructor=e).__proto__=t;var n=r.prototype;return n.componentDidMount=function(){this._isMounted=!0,this.state.subscription.trySubscribe(),this.previousState!==this.props.store.getState()&&this.state.subscription.notifyNestedSubs()},n.componentWillUnmount=function(){this.unsubscribe&&this.unsubscribe(),this.state.subscription.tryUnsubscribe(),this._isMounted=!1},n.componentDidUpdate=function(e){if(this.props.store!==e.store){this.state.subscription.tryUnsubscribe();var t=new T(this.props.store);t.onStateChange=this.notifySubscribers,this.setState({store:this.props.store,subscription:t})}},n.notifySubscribers=function(){this.state.subscription.notifyNestedSubs()},n.render=function(){return E.createElement((this.props.context||b).Provider,{value:this.state},this.props.children)},r}(M.Component);function j(){return(j=Object.assign||function(e){for(var t=1;t<arguments.length;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 _(e,t){if(null==e)return{};var r,n,o={},i=Object.keys(e);for(n=0;n<i.length;n++)t.indexOf(r=i[n])<0&&(o[r]=e[r]);return o}c.propTypes={store:s.shape({subscribe:s.func.isRequired,dispatch:s.func.isRequired,getState:s.func.isRequired}),context:s.object,children:s.any};var p,f=t(function(e,t){Object.defineProperty(t,"__esModule",{value:!0});var r="function"==typeof Symbol&&Symbol.for,n=r?Symbol.for("react.element"):60103,o=r?Symbol.for("react.portal"):60106,i=r?Symbol.for("react.fragment"):60107,s=r?Symbol.for("react.strict_mode"):60108,u=r?Symbol.for("react.profiler"):60114,a=r?Symbol.for("react.provider"):60109,c=r?Symbol.for("react.context"):60110,p=r?Symbol.for("react.async_mode"):60111,f=r?Symbol.for("react.concurrent_mode"):60111,d=r?Symbol.for("react.forward_ref"):60112,l=r?Symbol.for("react.suspense"):60113,y=r?Symbol.for("react.memo"):60115,h=r?Symbol.for("react.lazy"):60116;function m(e){if("object"==typeof e&&null!==e){var t=e.$$typeof;switch(t){case n:switch(e=e.type){case p:case f:case i:case u:case s:case l:return e;default:switch(e=e&&e.$$typeof){case c:case d:case a:return e;default:return t}}case h:case y:case o:return t}}}function b(e){return m(e)===f}t.typeOf=m,t.AsyncMode=p,t.ConcurrentMode=f,t.ContextConsumer=c,t.ContextProvider=a,t.Element=n,t.ForwardRef=d,t.Fragment=i,t.Lazy=h,t.Memo=y,t.Portal=o,t.Profiler=u,t.StrictMode=s,t.Suspense=l,t.isValidElementType=function(e){return"string"==typeof e||"function"==typeof e||e===i||e===f||e===u||e===s||e===l||"object"==typeof e&&null!==e&&(e.$$typeof===h||e.$$typeof===y||e.$$typeof===a||e.$$typeof===c||e.$$typeof===d)},t.isAsyncMode=function(e){return b(e)||m(e)===p},t.isConcurrentMode=b,t.isContextConsumer=function(e){return m(e)===c},t.isContextProvider=function(e){return m(e)===a},t.isElement=function(e){return"object"==typeof e&&null!==e&&e.$$typeof===n},t.isForwardRef=function(e){return m(e)===d},t.isFragment=function(e){return m(e)===i},t.isLazy=function(e){return m(e)===h},t.isMemo=function(e){return m(e)===y},t.isPortal=function(e){return m(e)===o},t.isProfiler=function(e){return m(e)===u},t.isStrictMode=function(e){return m(e)===s},t.isSuspense=function(e){return m(e)===l}});(p=f)&&p.__esModule&&Object.prototype.hasOwnProperty.call(p,"default");var d=t(function(e){e.exports=f}),N=d.isContextConsumer,l={childContextTypes:!0,contextType:!0,contextTypes:!0,defaultProps:!0,displayName:!0,getDefaultProps:!0,getDerivedStateFromError:!0,getDerivedStateFromProps:!0,mixins:!0,propTypes:!0,type:!0},y={name:!0,length:!0,prototype:!0,caller:!0,callee:!0,arguments:!0,arity:!0},h={$$typeof:!0,compare:!0,defaultProps:!0,displayName:!0,propTypes:!0,type:!0},m={};function v(e){return d.isMemo(e)?h:m[e.$$typeof]||l}m[d.ForwardRef]={$$typeof:!0,render:!0,defaultProps:!0,displayName:!0,propTypes:!0};var P=Object.defineProperty,S=Object.getOwnPropertyNames,g=Object.getOwnPropertySymbols,O=Object.getOwnPropertyDescriptor,C=Object.getPrototypeOf,w=Object.prototype;var q=function e(t,r,n){if("string"==typeof r)return t;if(w){var o=C(r);o&&o!==w&&e(t,o,n)}var i=S(r);g&&(i=i.concat(g(r)));for(var s=v(t),u=v(r),a=0;a<i.length;++a){var c=i[a];if(!(y[c]||n&&n[c]||u&&u[c]||s&&s[c])){var p=O(r,c);try{P(t,c,p)}catch(e){}}}return t},$=function(e,t,r,n,o,i,s,u){if(!e){var a;if(void 0===t)a=Error("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{var c=[r,n,o,i,s,u],p=0;(a=Error(t.replace(/%s/g,function(){return c[p++]}))).name="Invariant Violation"}throw a.framesToPop=1,a}},D=[],F=[null,null];function W(e,t){return[t.payload,e[1]+1]}var U=function(){return[null,0]};function x(w,e){void 0===e&&(e={});var t=e.getDisplayName,i=void 0===t?function(e){return"ConnectAdvanced("+e+")"}:t,r=e.methodName,s=void 0===r?"connectAdvanced":r,n=e.renderCountProp,u=void 0===n?void 0:n,o=e.shouldHandleStateChanges,x=void 0===o||o,a=e.storeKey,c=void 0===a?"store":a,p=e.withRef,f=void 0!==p&&p,d=e.forwardRef,l=void 0!==d&&d,y=e.context,h=void 0===y?b:y,m=_(e,["getDisplayName","methodName","renderCountProp","shouldHandleStateChanges","storeKey","withRef","forwardRef","context"]);$(void 0===u,"renderCountProp is removed. render counting is built into the latest React dev tools profiling extension"),$(!f,"withRef is removed. To access the wrapped instance, use a ref on the connected component");$("store"===c,"storeKey has been removed and does not do anything. To use a custom Redux store for specific components, create a custom React context with React.createContext(), and pass the context object to React Redux's Provider and specific components like: <Provider context={MyContext}><ConnectedComponent context={MyContext} /></Provider>. You may also pass a {context : MyContext} option to connect");var R=h;return function(S){var e=S.displayName||S.name||"Component",g=i(e),O=j({},m,{getDisplayName:i,methodName:s,renderCountProp:u,shouldHandleStateChanges:x,storeKey:c,displayName:g,wrappedComponentName:e,WrappedComponent:S}),t=m.pure;var C=t?M.useMemo:function(e){return e()};function r(e){var t=M.useMemo(function(){return[e.context,e.forwardedRef,_(e,["context","forwardedRef"])]},[e]),r=t[0],n=t[1],o=t[2],i=M.useMemo(function(){return r&&r.Consumer&&N(E.createElement(r.Consumer,null))?r:R},[r,R]),s=M.useContext(i);$(e.store||s,'Could not find "store" in the context of "'+g+'". Either wrap the root component in a <Provider>, or pass a custom React context provider to <Provider> and the corresponding React context consumer to '+g+" in connect options.");var u=e.store||s.store,a=M.useMemo(function(){return w(u.dispatch,O)},[u]),c=M.useMemo(function(){if(!x)return F;var e=new T(u,s.subscription),t=e.notifyNestedSubs.bind(e);return[e,t]},[u,s.subscription]),p=c[0],f=c[1],d=M.useMemo(function(){return j({},s,{subscription:p})},[s,p]),l=M.useReducer(W,D,U),y=l[0][0],h=l[1];if(y&&y.error)throw y.error;var m=M.useRef(),b=M.useRef(o),v=M.useRef(),P=C(function(){return v.current&&o===b.current?v.current:a(u.getState(),o)},[u,y,o]);return M.useEffect(function(){b.current=o,m.current=P,v.current&&(v.current=null,f())}),M.useEffect(function(){if(x){var n=!1,e=function(){if(!n){var e,t,r=u.getState();try{e=a(r,b.current)}catch(e){t=e}e===m.current?f():(h({type:"STORE_UPDATED",payload:{latestStoreState:r,error:t}}),v.current=m.current=e)}};p.onStateChange=e,p.trySubscribe(),e();return function(){n=!0,p.tryUnsubscribe()}}},[u,p,a]),M.useMemo(function(){var e=E.createElement(S,j({},P,{ref:n}));return x?E.createElement(i.Provider,{value:d},e):e},[i,S,P,n,d])}var n=t?E.memo(r):r;if(n.WrappedComponent=S,n.displayName=g,l){var o=E.forwardRef(function(e,t){return E.createElement(n,{wrapperProps:e,forwardedRef:t})});return o.displayName=g,o.WrappedComponent=S,q(o,S)}return q(n,S)}}var R=Object.prototype.hasOwnProperty;function k(e,t){return e===t?0!==e||0!==t||1/e==1/t:e!=e&&t!=t}function A(e,t){if(k(e,t))return!0;if("object"!=typeof e||null===e||"object"!=typeof t||null===t)return!1;var r=Object.keys(e);if(r.length!==Object.keys(t).length)return!1;for(var n=0;n<r.length;n++)if(!R.call(t,r[n])||!k(e[r[n]],t[r[n]]))return!1;return!0}function H(o){return function(e,t){var r=o(e,t);function n(){return r}return n.dependsOnOwnProps=!1,n}}function I(e){return null!=e.dependsOnOwnProps?!!e.dependsOnOwnProps:1!==e.length}function K(o,e){return function(e,t){var n=function(e,t){return n.dependsOnOwnProps?n.mapToProps(e,t):n.mapToProps(e)};return n.dependsOnOwnProps=!0,n.mapToProps=function(e,t){n.mapToProps=o,n.dependsOnOwnProps=I(o);var r=n(e,t);return"function"==typeof r&&(n.mapToProps=r,n.dependsOnOwnProps=I(r),r=n(e,t)),r},n}}function L(e,t,r){return j({},r,e,t)}function z(r,n,o,i){return function(e,t){return o(r(e,t),n(i,t),t)}}function V(s,u,a,c,e){var p,f,d,l,y,h=e.areStatesEqual,m=e.areOwnPropsEqual,b=e.areStatePropsEqual,r=!1;function n(e,t){var r,n,o=!m(t,f),i=!h(e,p);return p=e,f=t,o&&i?(d=s(p,f),u.dependsOnOwnProps&&(l=u(c,f)),y=a(d,l,f)):o?(s.dependsOnOwnProps&&(d=s(p,f)),u.dependsOnOwnProps&&(l=u(c,f)),y=a(d,l,f)):(i&&(r=s(p,f),n=!b(r,d),d=r,n&&(y=a(d,l,f))),y)}return function(e,t){return r?n(e,t):(d=s(p=e,f=t),l=u(c,f),y=a(d,l,f),r=!0,y)}}function Y(e,t){var r=t.initMapStateToProps,n=t.initMapDispatchToProps,o=t.initMergeProps,i=_(t,["initMapStateToProps","initMapDispatchToProps","initMergeProps"]),s=r(e,i),u=n(e,i),a=o(e,i);return(i.pure?V:z)(s,u,a,e,i)}function B(r,e,n){for(var t=e.length-1;0<=t;t--){var o=e[t](r);if(o)return o}return function(e,t){throw Error("Invalid value of type "+typeof r+" for "+n+" argument when connecting component "+t.wrappedComponentName+".")}}function G(e,t){return e===t}var J,Q,X,Z,ee,te,re,ne,oe,ie,se,ue,ae=(Z=void 0===(X=(Q=void 0===J?{}:J).connectHOC)?x:X,te=void 0===(ee=Q.mapStateToPropsFactories)?[function(e){return"function"==typeof e?K(e):void 0},function(e){return e?void 0:H(function(){return{}})}]:ee,ne=void 0===(re=Q.mapDispatchToPropsFactories)?[function(e){return"function"==typeof e?K(e):void 0},function(e){return e?void 0:H(function(e){return{dispatch:e}})},function(t){return t&&"object"==typeof t?H(function(e){return r.bindActionCreators(t,e)}):void 0}]:re,ie=void 0===(oe=Q.mergePropsFactories)?[function(e){return"function"==typeof e?(a=e,function(e,t){var o,i=t.pure,s=t.areMergedPropsEqual,u=!1;return function(e,t,r){var n=a(e,t,r);return u?i&&s(n,o)||(o=n):(u=!0,o=n),o}}):void 0;var a},function(e){return e?void 0:function(){return L}}]:oe,ue=void 0===(se=Q.selectorFactory)?Y:se,function(e,t,r,n){void 0===n&&(n={});var o=n.pure,i=void 0===o||o,s=n.areStatesEqual,u=void 0===s?G:s,a=n.areOwnPropsEqual,c=void 0===a?A:a,p=n.areStatePropsEqual,f=void 0===p?A:p,d=n.areMergedPropsEqual,l=void 0===d?A:d,y=_(n,["pure","areStatesEqual","areOwnPropsEqual","areStatePropsEqual","areMergedPropsEqual"]),h=B(e,te,"mapStateToProps"),m=B(t,ne,"mapDispatchToProps"),b=B(r,ie,"mergeProps");return Z(ue,j({methodName:"connect",getDisplayName:function(e){return"Connect("+e+")"},shouldHandleStateChanges:!!e,initMapStateToProps:h,initMapDispatchToProps:m,initMergeProps:b,pure:i,areStatesEqual:u,areOwnPropsEqual:c,areStatePropsEqual:f,areMergedPropsEqual:l},y))});e.Provider=c,e.connectAdvanced=x,e.ReactReduxContext=b,e.connect=ae,Object.defineProperty(e,"__esModule",{value:!0})}); | ||
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("react"),require("redux"),require("react-dom")):"function"==typeof define&&define.amd?define(["exports","react","redux","react-dom"],t):t(e.ReactRedux={},e.React,e.Redux,e.ReactDOM)}(this,function(e,M,r,t){"use strict";var E="default"in M?M.default:M;function n(e,t){return e(t={exports:{}},t.exports),t.exports}function o(){}function i(){}i.resetWarningCache=o;var s=n(function(e){e.exports=function(){function e(e,t,r,n,o,i){if("SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"!==i){var s=Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw s.name="Invariant Violation",s}}function t(){return e}var r={array:e.isRequired=e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,elementType:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t,checkPropTypes:i,resetWarningCache:o};return r.PropTypes=r}()}),m=E.createContext(null);var a=function(e){e()},u=null,c={notify:function(){}};var T=function(){function e(e,t){this.store=e,this.parentSub=t,this.unsubscribe=null,this.listeners=c,this.handleChangeWrapper=this.handleChangeWrapper.bind(this)}var t=e.prototype;return t.addNestedSub=function(e){return this.trySubscribe(),this.listeners.subscribe(e)},t.notifyNestedSubs=function(){this.listeners.notify()},t.handleChangeWrapper=function(){this.onStateChange&&this.onStateChange()},t.isSubscribed=function(){return!!this.unsubscribe},t.trySubscribe=function(){var e,r,n;this.unsubscribe||(this.unsubscribe=this.parentSub?this.parentSub.addNestedSub(this.handleChangeWrapper):this.store.subscribe(this.handleChangeWrapper),this.listeners=(e=a,r=[],n=[],{clear:function(){r=n=u},notify:function(){var t=r=n;e(function(){for(var e=0;e<t.length;e++)t[e]()})},get:function(){return n},subscribe:function(e){var t=!0;return n===r&&(n=r.slice()),n.push(e),function(){t&&r!==u&&(t=!1,n===r&&(n=r.slice()),n.splice(n.indexOf(e),1))}}}))},t.tryUnsubscribe=function(){this.unsubscribe&&(this.unsubscribe(),this.unsubscribe=null,this.listeners.clear(),this.listeners=c)},e}(),p=function(o){var e,t;function r(e){var t;t=o.call(this,e)||this;var r=e.store;t.notifySubscribers=t.notifySubscribers.bind(function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(t));var n=new T(r);return n.onStateChange=t.notifySubscribers,t.state={store:r,subscription:n},t.previousState=r.getState(),t}(e=r).prototype=Object.create((t=o).prototype),(e.prototype.constructor=e).__proto__=t;var n=r.prototype;return n.componentDidMount=function(){this._isMounted=!0,this.state.subscription.trySubscribe(),this.previousState!==this.props.store.getState()&&this.state.subscription.notifyNestedSubs()},n.componentWillUnmount=function(){this.unsubscribe&&this.unsubscribe(),this.state.subscription.tryUnsubscribe(),this._isMounted=!1},n.componentDidUpdate=function(e){if(this.props.store!==e.store){this.state.subscription.tryUnsubscribe();var t=new T(this.props.store);t.onStateChange=this.notifySubscribers,this.setState({store:this.props.store,subscription:t})}},n.notifySubscribers=function(){this.state.subscription.notifyNestedSubs()},n.render=function(){return E.createElement((this.props.context||m).Provider,{value:this.state},this.props.children)},r}(M.Component);function _(){return(_=Object.assign||function(e){for(var t=1;t<arguments.length;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 j(e,t){if(null==e)return{};var r,n,o={},i=Object.keys(e);for(n=0;n<i.length;n++)t.indexOf(r=i[n])<0&&(o[r]=e[r]);return o}p.propTypes={store:s.shape({subscribe:s.func.isRequired,dispatch:s.func.isRequired,getState:s.func.isRequired}),context:s.object,children:s.any};var f,d=n(function(e,t){Object.defineProperty(t,"__esModule",{value:!0});var r="function"==typeof Symbol&&Symbol.for,n=r?Symbol.for("react.element"):60103,o=r?Symbol.for("react.portal"):60106,i=r?Symbol.for("react.fragment"):60107,s=r?Symbol.for("react.strict_mode"):60108,a=r?Symbol.for("react.profiler"):60114,u=r?Symbol.for("react.provider"):60109,c=r?Symbol.for("react.context"):60110,p=r?Symbol.for("react.async_mode"):60111,f=r?Symbol.for("react.concurrent_mode"):60111,d=r?Symbol.for("react.forward_ref"):60112,l=r?Symbol.for("react.suspense"):60113,y=r?Symbol.for("react.memo"):60115,h=r?Symbol.for("react.lazy"):60116;function b(e){if("object"==typeof e&&null!==e){var t=e.$$typeof;switch(t){case n:switch(e=e.type){case p:case f:case i:case a:case s:case l:return e;default:switch(e=e&&e.$$typeof){case c:case d:case u:return e;default:return t}}case h:case y:case o:return t}}}function m(e){return b(e)===f}t.typeOf=b,t.AsyncMode=p,t.ConcurrentMode=f,t.ContextConsumer=c,t.ContextProvider=u,t.Element=n,t.ForwardRef=d,t.Fragment=i,t.Lazy=h,t.Memo=y,t.Portal=o,t.Profiler=a,t.StrictMode=s,t.Suspense=l,t.isValidElementType=function(e){return"string"==typeof e||"function"==typeof e||e===i||e===f||e===a||e===s||e===l||"object"==typeof e&&null!==e&&(e.$$typeof===h||e.$$typeof===y||e.$$typeof===u||e.$$typeof===c||e.$$typeof===d)},t.isAsyncMode=function(e){return m(e)||b(e)===p},t.isConcurrentMode=m,t.isContextConsumer=function(e){return b(e)===c},t.isContextProvider=function(e){return b(e)===u},t.isElement=function(e){return"object"==typeof e&&null!==e&&e.$$typeof===n},t.isForwardRef=function(e){return b(e)===d},t.isFragment=function(e){return b(e)===i},t.isLazy=function(e){return b(e)===h},t.isMemo=function(e){return b(e)===y},t.isPortal=function(e){return b(e)===o},t.isProfiler=function(e){return b(e)===a},t.isStrictMode=function(e){return b(e)===s},t.isSuspense=function(e){return b(e)===l}});(f=d)&&f.__esModule&&Object.prototype.hasOwnProperty.call(f,"default");var l=n(function(e){e.exports=d}),N=l.isContextConsumer,y={childContextTypes:!0,contextType:!0,contextTypes:!0,defaultProps:!0,displayName:!0,getDefaultProps:!0,getDerivedStateFromError:!0,getDerivedStateFromProps:!0,mixins:!0,propTypes:!0,type:!0},h={name:!0,length:!0,prototype:!0,caller:!0,callee:!0,arguments:!0,arity:!0},b={$$typeof:!0,compare:!0,defaultProps:!0,displayName:!0,propTypes:!0,type:!0},v={};function P(e){return l.isMemo(e)?b:v[e.$$typeof]||y}v[l.ForwardRef]={$$typeof:!0,render:!0,defaultProps:!0,displayName:!0,propTypes:!0};var S=Object.defineProperty,g=Object.getOwnPropertyNames,O=Object.getOwnPropertySymbols,C=Object.getOwnPropertyDescriptor,w=Object.getPrototypeOf,x=Object.prototype;var q=function e(t,r,n){if("string"==typeof r)return t;if(x){var o=w(r);o&&o!==x&&e(t,o,n)}var i=g(r);O&&(i=i.concat(O(r)));for(var s=P(t),a=P(r),u=0;u<i.length;++u){var c=i[u];if(!(h[c]||n&&n[c]||a&&a[c]||s&&s[c])){var p=C(r,c);try{S(t,c,p)}catch(e){}}}return t},$=function(e,t,r,n,o,i,s,a){if(!e){var u;if(void 0===t)u=Error("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{var c=[r,n,o,i,s,a],p=0;(u=Error(t.replace(/%s/g,function(){return c[p++]}))).name="Invariant Violation"}throw u.framesToPop=1,u}},D=[],F=[null,null];function W(e,t){return[t.payload,e[1]+1]}var U=function(){return[null,0]};function R(w,e){void 0===e&&(e={});var t=e.getDisplayName,i=void 0===t?function(e){return"ConnectAdvanced("+e+")"}:t,r=e.methodName,s=void 0===r?"connectAdvanced":r,n=e.renderCountProp,a=void 0===n?void 0:n,o=e.shouldHandleStateChanges,x=void 0===o||o,u=e.storeKey,c=void 0===u?"store":u,p=e.withRef,f=void 0!==p&&p,d=e.forwardRef,l=void 0!==d&&d,y=e.context,h=void 0===y?m:y,b=j(e,["getDisplayName","methodName","renderCountProp","shouldHandleStateChanges","storeKey","withRef","forwardRef","context"]);$(void 0===a,"renderCountProp is removed. render counting is built into the latest React dev tools profiling extension"),$(!f,"withRef is removed. To access the wrapped instance, use a ref on the connected component");$("store"===c,"storeKey has been removed and does not do anything. To use a custom Redux store for specific components, create a custom React context with React.createContext(), and pass the context object to React Redux's Provider and specific components like: <Provider context={MyContext}><ConnectedComponent context={MyContext} /></Provider>. You may also pass a {context : MyContext} option to connect");var R=h;return function(S){var e=S.displayName||S.name||"Component",g=i(e),O=_({},b,{getDisplayName:i,methodName:s,renderCountProp:a,shouldHandleStateChanges:x,storeKey:c,displayName:g,wrappedComponentName:e,WrappedComponent:S}),t=b.pure;var C=t?M.useMemo:function(e){return e()};function r(e){var t=M.useMemo(function(){return[e.context,e.forwardedRef,j(e,["context","forwardedRef"])]},[e]),r=t[0],n=t[1],o=t[2],i=M.useMemo(function(){return r&&r.Consumer&&N(E.createElement(r.Consumer,null))?r:R},[r,R]),s=M.useContext(i);$(e.store||s,'Could not find "store" in the context of "'+g+'". Either wrap the root component in a <Provider>, or pass a custom React context provider to <Provider> and the corresponding React context consumer to '+g+" in connect options.");var a=e.store||s.store,u=M.useMemo(function(){return w(a.dispatch,O)},[a]),c=M.useMemo(function(){if(!x)return F;var e=new T(a,s.subscription),t=e.notifyNestedSubs.bind(e);return[e,t]},[a,s.subscription]),p=c[0],f=c[1],d=M.useMemo(function(){return _({},s,{subscription:p})},[s,p]),l=M.useReducer(W,D,U),y=l[0][0],h=l[1];if(y&&y.error)throw y.error;var b=M.useRef(),m=M.useRef(o),v=M.useRef(),P=C(function(){return v.current&&o===m.current?v.current:u(a.getState(),o)},[a,y,o]);return M.useEffect(function(){m.current=o,b.current=P,v.current&&(v.current=null,f())}),M.useEffect(function(){if(x){var n=!1,e=function(){if(!n){var e,t,r=a.getState();try{e=u(r,m.current)}catch(e){t=e}e===b.current?f():(h({type:"STORE_UPDATED",payload:{latestStoreState:r,error:t}}),v.current=b.current=e)}};p.onStateChange=e,p.trySubscribe(),e();return function(){n=!0,p.tryUnsubscribe()}}},[a,p,u]),M.useMemo(function(){var e=E.createElement(S,_({},P,{ref:n}));return x?E.createElement(i.Provider,{value:d},e):e},[i,S,P,n,d])}var n=t?E.memo(r):r;if(n.WrappedComponent=S,n.displayName=g,l){var o=E.forwardRef(function(e,t){return E.createElement(n,{wrapperProps:e,forwardedRef:t})});return o.displayName=g,o.WrappedComponent=S,q(o,S)}return q(n,S)}}var k=Object.prototype.hasOwnProperty;function A(e,t){return e===t?0!==e||0!==t||1/e==1/t:e!=e&&t!=t}function H(e,t){if(A(e,t))return!0;if("object"!=typeof e||null===e||"object"!=typeof t||null===t)return!1;var r=Object.keys(e);if(r.length!==Object.keys(t).length)return!1;for(var n=0;n<r.length;n++)if(!k.call(t,r[n])||!A(e[r[n]],t[r[n]]))return!1;return!0}function I(o){return function(e,t){var r=o(e,t);function n(){return r}return n.dependsOnOwnProps=!1,n}}function K(e){return null!=e.dependsOnOwnProps?!!e.dependsOnOwnProps:1!==e.length}function L(o,e){return function(e,t){var n=function(e,t){return n.dependsOnOwnProps?n.mapToProps(e,t):n.mapToProps(e)};return n.dependsOnOwnProps=!0,n.mapToProps=function(e,t){n.mapToProps=o,n.dependsOnOwnProps=K(o);var r=n(e,t);return"function"==typeof r&&(n.mapToProps=r,n.dependsOnOwnProps=K(r),r=n(e,t)),r},n}}function z(e,t,r){return _({},r,e,t)}function V(r,n,o,i){return function(e,t){return o(r(e,t),n(i,t),t)}}function Y(s,a,u,c,e){var p,f,d,l,y,h=e.areStatesEqual,b=e.areOwnPropsEqual,m=e.areStatePropsEqual,r=!1;function n(e,t){var r,n,o=!b(t,f),i=!h(e,p);return p=e,f=t,o&&i?(d=s(p,f),a.dependsOnOwnProps&&(l=a(c,f)),y=u(d,l,f)):o?(s.dependsOnOwnProps&&(d=s(p,f)),a.dependsOnOwnProps&&(l=a(c,f)),y=u(d,l,f)):(i&&(r=s(p,f),n=!m(r,d),d=r,n&&(y=u(d,l,f))),y)}return function(e,t){return r?n(e,t):(d=s(p=e,f=t),l=a(c,f),y=u(d,l,f),r=!0,y)}}function B(e,t){var r=t.initMapStateToProps,n=t.initMapDispatchToProps,o=t.initMergeProps,i=j(t,["initMapStateToProps","initMapDispatchToProps","initMergeProps"]),s=r(e,i),a=n(e,i),u=o(e,i);return(i.pure?Y:V)(s,a,u,e,i)}function G(r,e,n){for(var t=e.length-1;0<=t;t--){var o=e[t](r);if(o)return o}return function(e,t){throw Error("Invalid value of type "+typeof r+" for "+n+" argument when connecting component "+t.wrappedComponentName+".")}}function J(e,t){return e===t}var Q,X,Z,ee,te,re,ne,oe,ie,se,ae,ue,ce=(ee=void 0===(Z=(X=void 0===Q?{}:Q).connectHOC)?R:Z,re=void 0===(te=X.mapStateToPropsFactories)?[function(e){return"function"==typeof e?L(e):void 0},function(e){return e?void 0:I(function(){return{}})}]:te,oe=void 0===(ne=X.mapDispatchToPropsFactories)?[function(e){return"function"==typeof e?L(e):void 0},function(e){return e?void 0:I(function(e){return{dispatch:e}})},function(t){return t&&"object"==typeof t?I(function(e){return r.bindActionCreators(t,e)}):void 0}]:ne,se=void 0===(ie=X.mergePropsFactories)?[function(e){return"function"==typeof e?(u=e,function(e,t){var o,i=t.pure,s=t.areMergedPropsEqual,a=!1;return function(e,t,r){var n=u(e,t,r);return a?i&&s(n,o)||(o=n):(a=!0,o=n),o}}):void 0;var u},function(e){return e?void 0:function(){return z}}]:ie,ue=void 0===(ae=X.selectorFactory)?B:ae,function(e,t,r,n){void 0===n&&(n={});var o=n.pure,i=void 0===o||o,s=n.areStatesEqual,a=void 0===s?J:s,u=n.areOwnPropsEqual,c=void 0===u?H:u,p=n.areStatePropsEqual,f=void 0===p?H:p,d=n.areMergedPropsEqual,l=void 0===d?H:d,y=j(n,["pure","areStatesEqual","areOwnPropsEqual","areStatePropsEqual","areMergedPropsEqual"]),h=G(e,re,"mapStateToProps"),b=G(t,oe,"mapDispatchToProps"),m=G(r,se,"mergeProps");return ee(ue,_({methodName:"connect",getDisplayName:function(e){return"Connect("+e+")"},shouldHandleStateChanges:!!e,initMapStateToProps:h,initMapDispatchToProps:b,initMergeProps:m,pure:i,areStatesEqual:a,areOwnPropsEqual:c,areStatePropsEqual:f,areMergedPropsEqual:l},y))});a=t.unstable_batchedUpdates,e.batch=t.unstable_batchedUpdates,e.Provider=p,e.connectAdvanced=R,e.ReactReduxContext=m,e.connect=ce,Object.defineProperty(e,"__esModule",{value:!0})}); |
@@ -5,2 +5,5 @@ import Provider from './components/Provider'; | ||
import connect from './connect/connect'; | ||
export { Provider, connectAdvanced, ReactReduxContext, connect }; | ||
import { setBatch } from './utils/batch'; | ||
import { unstable_batchedUpdates as batch } from './utils/reactBatchedUpdates'; | ||
setBatch(batch); | ||
export { Provider, connectAdvanced, ReactReduxContext, connect, batch }; |
@@ -1,2 +0,2 @@ | ||
import { unstable_batchedUpdates } from 'react-dom'; // encapsulates the subscription logic for connecting a component to the redux store, as | ||
import { getBatch } from './batch'; // encapsulates the subscription logic for connecting a component to the redux store, as | ||
// well as nesting subscriptions of descendant components, so that we can ensure the | ||
@@ -10,3 +10,3 @@ // ancestor components re-render before descendants | ||
function createListenerCollection() { | ||
function createListenerCollection(batch) { | ||
// the current/next pattern is copied from redux's createStore code. | ||
@@ -23,3 +23,3 @@ // TODO: refactor+expose that code to be reusable here? | ||
var listeners = current = next; | ||
unstable_batchedUpdates(function () { | ||
batch(function () { | ||
for (var i = 0; i < listeners.length; i++) { | ||
@@ -82,3 +82,3 @@ listeners[i](); | ||
this.unsubscribe = this.parentSub ? this.parentSub.addNestedSub(this.handleChangeWrapper) : this.store.subscribe(this.handleChangeWrapper); | ||
this.listeners = createListenerCollection(); | ||
this.listeners = createListenerCollection(getBatch()); | ||
} | ||
@@ -85,0 +85,0 @@ }; |
@@ -21,2 +21,9 @@ "use strict"; | ||
exports.connect = _connect.default; | ||
exports.connect = _connect.default; | ||
var _batch = require("./utils/batch"); | ||
var _reactBatchedUpdates = require("./utils/reactBatchedUpdates"); | ||
exports.batch = _reactBatchedUpdates.unstable_batchedUpdates; | ||
(0, _batch.setBatch)(_reactBatchedUpdates.unstable_batchedUpdates); |
@@ -6,3 +6,3 @@ "use strict"; | ||
var _reactDom = require("react-dom"); | ||
var _batch = require("./batch"); | ||
@@ -17,3 +17,3 @@ // encapsulates the subscription logic for connecting a component to the redux store, as | ||
function createListenerCollection() { | ||
function createListenerCollection(batch) { | ||
// the current/next pattern is copied from redux's createStore code. | ||
@@ -30,3 +30,3 @@ // TODO: refactor+expose that code to be reusable here? | ||
var listeners = current = next; | ||
(0, _reactDom.unstable_batchedUpdates)(function () { | ||
batch(function () { | ||
for (var i = 0; i < listeners.length; i++) { | ||
@@ -89,3 +89,3 @@ listeners[i](); | ||
this.unsubscribe = this.parentSub ? this.parentSub.addNestedSub(this.handleChangeWrapper) : this.store.subscribe(this.handleChangeWrapper); | ||
this.listeners = createListenerCollection(); | ||
this.listeners = createListenerCollection((0, _batch.getBatch)()); | ||
} | ||
@@ -92,0 +92,0 @@ }; |
{ | ||
"name": "@acemarke/react-redux", | ||
"version": "7.0.0-alpha.3", | ||
"version": "7.0.0-alpha.4", | ||
"description": "(un)Official React bindings for Redux", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
@@ -6,2 +6,7 @@ import Provider from './components/Provider' | ||
export { Provider, connectAdvanced, ReactReduxContext, connect } | ||
import { setBatch } from './utils/batch' | ||
import { unstable_batchedUpdates as batch } from './utils/reactBatchedUpdates' | ||
setBatch(batch) | ||
export { Provider, connectAdvanced, ReactReduxContext, connect, batch } |
@@ -1,2 +0,2 @@ | ||
import { unstable_batchedUpdates } from 'react-dom' | ||
import { getBatch } from './batch' | ||
@@ -10,3 +10,3 @@ // encapsulates the subscription logic for connecting a component to the redux store, as | ||
function createListenerCollection() { | ||
function createListenerCollection(batch) { | ||
// the current/next pattern is copied from redux's createStore code. | ||
@@ -25,3 +25,3 @@ // TODO: refactor+expose that code to be reusable here? | ||
const listeners = (current = next) | ||
unstable_batchedUpdates(() => { | ||
batch(() => { | ||
for (let i = 0; i < listeners.length; i++) { | ||
@@ -88,3 +88,3 @@ listeners[i]() | ||
this.listeners = createListenerCollection() | ||
this.listeners = createListenerCollection(getBatch()) | ||
} | ||
@@ -91,0 +91,0 @@ } |
Sorry, the diff of this file is too big to display
210348
69
4384