var __awaiter=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(u,a){function c(e){try{o(r.next(e))}catch(e){a(e)}}function i(e){try{o(r.throw(e))}catch(e){a(e)}}function o(e){var t;e.done?u(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(c,i)}o((r=r.apply(e,t||[])).next())}))};import{useEffect,useRef,useState}from"react";import{getExternalExampleValue}from"../../models";export function useExternalExample(e,t){const[,n]=useState(!0),r=useRef(void 0),u=useRef(void 0);return u.current!==e&&(r.current=void 0),u.current=e,useEffect((()=>{(()=>{__awaiter(this,void 0,void 0,(function*(){n(!0);try{r.current=yield getExternalExampleValue(t,e.externalValueUrl)}catch(e){r.current=e}n(!1)}))})()}),[e,t]),r.current}
//# sourceMappingURL=useExternalExample.js.map