Liferay.Loader.define("@liferay/analytics-settings-web@5.0.51/js/utils/useRequest",["module","exports","require","liferay!frontend-js-react-web$react"],(function(e,r,t){window;Object.defineProperty(r,"__esModule",{value:!0}),r.useRequest=function useRequest(e,r){const[t,{data:n,error:s,loading:o}]=function useInternalRequest(e,r){const[t,n]=(0,a.useState)(null),[s,o]=(0,a.useState)(!1),[u,i]=(0,a.useState)(!1);return[(0,a.useCallback)((async()=>{i(!0);const t=await e(r);try{if(t.error)throw t.error;n(t)}catch(e){console.error(e),o(!0)}i(!1)}),[e,JSON.stringify(r)]),{data:t,error:s,loading:u}]}(e,r);return(0,a.useEffect)((()=>{t()}),[t]),{data:n,error:s,loading:o,refetch:t}};var a=t("liferay!frontend-js-react-web$react")}));
//# sourceMappingURL=useRequest.js.map