import r from"@babel/runtime/helpers/asyncToGenerator";import e from"@babel/runtime/helpers/slicedToArray";import n from"@babel/runtime/regenerator";import{useState as a,useEffect as t}from"react";import o from"jsona";import{getAppPackages as i}from"../../../clients/jsonApi/index.js";var s=new o,c=function(o,c){var p=a({isLoading:!0,packages:[],error:null}),u=e(p,2),l=u[0],m=u[1];return t((function(){var e;(e=r(n.mark((function r(){var e;return n.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return r.prev=0,r.next=3,i(o,c);case 3:e=r.sent,m({isLoading:!1,packages:s.deserialize(e),error:null}),r.next=10;break;case 7:r.prev=7,r.t0=r.catch(0),m({isLoading:!1,packages:[],error:r.t0});case 10:case"end":return r.stop()}}),r,null,[[0,7]])}))),function(){return e.apply(this,arguments)})()}),[o]),l};export{c as default};
//# sourceMappingURL=index.js.map
