????
Current Path : C:/inetpub/vhost/yte.nextform.vn/wwwroot/assets/ |
Current File : C:/inetpub/vhost/yte.nextform.vn/wwwroot/assets/useSelector-DXN40xKf.js |
var __defProp=Object.defineProperty;var __name=(target,value)=>__defProp(target,"name",{value,configurable:!0});import{b as reactExports,bU as createSubscription,bV as useIsomorphicLayoutEffect,bW as ReactReduxContext,bX as useReduxContext}from"./index-D7FR_S6u.js";var refEquality=__name(function(a,b){return a===b},"refEquality2");function useSelectorWithStoreAndSubscription(selector,equalityFn,store,contextSub){var _useReducer=reactExports.useReducer(function(s){return s+1},0),forceRender=_useReducer[1],subscription=reactExports.useMemo(function(){return createSubscription(store,contextSub)},[store,contextSub]),latestSubscriptionCallbackError=reactExports.useRef(),latestSelector=reactExports.useRef(),latestStoreState=reactExports.useRef(),latestSelectedState=reactExports.useRef(),storeState=store.getState(),selectedState;try{if(selector!==latestSelector.current||storeState!==latestStoreState.current||latestSubscriptionCallbackError.current){var newSelectedState=selector(storeState);latestSelectedState.current===void 0||!equalityFn(newSelectedState,latestSelectedState.current)?selectedState=newSelectedState:selectedState=latestSelectedState.current}else selectedState=latestSelectedState.current}catch(err){throw latestSubscriptionCallbackError.current&&(err.message+=` The error may be correlated with this previous error: `+latestSubscriptionCallbackError.current.stack+` `),err}return useIsomorphicLayoutEffect(function(){latestSelector.current=selector,latestStoreState.current=storeState,latestSelectedState.current=selectedState,latestSubscriptionCallbackError.current=void 0}),useIsomorphicLayoutEffect(function(){function checkForUpdates(){try{var newStoreState=store.getState();if(newStoreState===latestStoreState.current)return;var _newSelectedState=latestSelector.current(newStoreState);if(equalityFn(_newSelectedState,latestSelectedState.current))return;latestSelectedState.current=_newSelectedState,latestStoreState.current=newStoreState}catch(err){latestSubscriptionCallbackError.current=err}forceRender()}return __name(checkForUpdates,"checkForUpdates"),subscription.onStateChange=checkForUpdates,subscription.trySubscribe(),checkForUpdates(),function(){return subscription.tryUnsubscribe()}},[store,subscription]),selectedState}__name(useSelectorWithStoreAndSubscription,"useSelectorWithStoreAndSubscription");function createSelectorHook(context){context===void 0&&(context=ReactReduxContext);var useReduxContext$1=context===ReactReduxContext?useReduxContext:function(){return reactExports.useContext(context)};return __name(function(selector,equalityFn){equalityFn===void 0&&(equalityFn=refEquality);{if(!selector)throw new Error("You must pass a selector to useSelector");if(typeof selector!="function")throw new Error("You must pass a function as a selector to useSelector");if(typeof equalityFn!="function")throw new Error("You must pass a function as an equality function to useSelector")}var _useReduxContext=useReduxContext$1(),store=_useReduxContext.store,contextSub=_useReduxContext.subscription,selectedState=useSelectorWithStoreAndSubscription(selector,equalityFn,store,contextSub);return reactExports.useDebugValue(selectedState),selectedState},"useSelector2")}__name(createSelectorHook,"createSelectorHook");var useSelector=createSelectorHook();export{useSelector as u};