"use strict";Liferay.Loader.define("portal-workflow-kaleo-designer-web$react-redux@7.2.8/lib/components/Provider",["module","exports","require","@portal-workflow-kaleo-designer-web$babel/runtime/helpers/interopRequireDefault","@portal-workflow-kaleo-designer-web$babel/runtime/helpers/interopRequireWildcard","liferay!frontend-js-react-web$react","liferay!frontend-js-react-web$prop-types","./Context","../utils/Subscription","../utils/useIsomorphicLayoutEffect"],(function(e,r,t){window;var o=t("@portal-workflow-kaleo-designer-web$babel/runtime/helpers/interopRequireDefault").default,i=t("@portal-workflow-kaleo-designer-web$babel/runtime/helpers/interopRequireWildcard").default;r.__esModule=!0,r.default=void 0;var n=i(t("liferay!frontend-js-react-web$react")),a=(o(t("liferay!frontend-js-react-web$prop-types")),t("./Context")),u=t("../utils/Subscription"),l=t("../utils/useIsomorphicLayoutEffect");r.default=function Provider(e){var r=e.store,t=e.context,o=e.children,i=(0,n.useMemo)((function(){var e=(0,u.createSubscription)(r);return{store:r,subscription:e}}),[r]),s=(0,n.useMemo)((function(){return r.getState()}),[r]);(0,l.useIsomorphicLayoutEffect)((function(){var e=i.subscription;return e.onStateChange=e.notifyNestedSubs,e.trySubscribe(),s!==r.getState()&&e.notifyNestedSubs(),function(){e.tryUnsubscribe(),e.onStateChange=null}}),[i,s]);var f=t||a.ReactReduxContext;return n.default.createElement(f.Provider,{value:i},o)}}));
//# sourceMappingURL=Provider.js.map