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