@corva/ui 0.97.0-11 → 0.97.0-12

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1 +1 @@
1
- "use strict";var e=require("@babel/runtime/helpers/asyncToGenerator"),r=require("@babel/runtime/helpers/slicedToArray"),t=require("@babel/runtime/regenerator"),a=require("lodash"),n=require("react");function u(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var i=u(e),o=u(r),s=u(t);module.exports=function(e){var r=e.loadFn,t=e.getDataFromResponseFn,u=void 0===t?a.identity((function(e){return e})):t,l=e.initialLoading,c=void 0===l||l,d=e.initialData,f=void 0===d?null:d,p=e.isCacheEnabled,b=void 0!==p&&p,v=n.useState(c),h=o.default(v,2),g=h[0],y=h[1],m=n.useState(f),q=o.default(m,2),x=q[0],k=q[1],D=n.useState(null),S=o.default(D,2),w=S[0],F=S[1],L=n.useRef({}),A=n.useCallback(a.debounce(i.default(s.default.mark((function e(){var t,a,n,i,o,l,c=arguments;return s.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:for(y(!0),e.prev=1,t=c.length,a=new Array(t),n=0;n<t;n++)a[n]=c[n];if(i=JSON.stringify(a),!L.current[i]||!b){e.next=7;break}return k(L.current[i]),e.abrupt("return");case 7:return e.next=9,r.apply(void 0,a);case 9:o=e.sent,l=u(o),k(l),b&&(L.current[i]=l),e.next=19;break;case 15:e.prev=15,e.t0=e.catch(1),F(e.t0),console.error(e.t0);case 19:return e.prev=19,y(!1),e.finish(19);case 22:case"end":return e.stop()}}),e,null,[[1,15,19,22]])}))),500),[u,r,b]);return{isLoading:g,data:x,error:w,loadData:A,setData:k,setIsLoading:y}};
1
+ "use strict";var e=require("@babel/runtime/helpers/asyncToGenerator"),r=require("@babel/runtime/helpers/slicedToArray"),t=require("@babel/runtime/regenerator"),a=require("lodash"),n=require("react");function u(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var i=u(e),o=u(r),l=u(t);module.exports=function(e){var r=e.loadFn,t=e.getDataFromResponseFn,u=void 0===t?a.identity((function(e){return e})):t,s=e.initialLoading,c=void 0===s||s,d=e.initialData,f=void 0===d?null:d,p=e.isCacheEnabled,b=void 0!==p&&p,v=n.useState(c),h=o.default(v,2),g=h[0],y=h[1],m=n.useState(f),q=o.default(m,2),x=q[0],k=q[1],D=n.useState(null),S=o.default(D,2),w=S[0],F=S[1],L=n.useRef({}),A=n.useCallback(a.debounce(i.default(l.default.mark((function e(){var t,n,i,o,s,c,d=arguments;return l.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:for(y(!0),e.prev=1,t=d.length,n=new Array(t),i=0;i<t;i++)n[i]=d[i];if(o=JSON.stringify(n),!L.current[o]||!b){e.next=7;break}return k(a.clone(L.current[o])),e.abrupt("return");case 7:return e.next=9,r.apply(void 0,n);case 9:s=e.sent,c=u(s),k(c),b&&(L.current[o]=c),e.next=19;break;case 15:e.prev=15,e.t0=e.catch(1),F(e.t0),console.error(e.t0);case 19:return e.prev=19,y(!1),e.finish(19);case 22:case"end":return e.stop()}}),e,null,[[1,15,19,22]])}))),500),[u,r,b]);return{isLoading:g,data:x,error:w,loadData:A,setData:k,setIsLoading:y}};
@@ -1 +1 @@
1
- import r from"@babel/runtime/helpers/asyncToGenerator";import e from"@babel/runtime/helpers/slicedToArray";import t from"@babel/runtime/regenerator";import{identity as n,debounce as a}from"lodash";import{useState as o,useRef as i,useCallback as s}from"react";function u(u){var c=u.loadFn,l=u.getDataFromResponseFn,p=void 0===l?n((function(r){return r})):l,d=u.initialLoading,f=void 0===d||d,m=u.initialData,v=void 0===m?null:m,b=u.isCacheEnabled,h=void 0!==b&&b,g=o(f),x=e(g,2),y=x[0],D=x[1],k=o(v),w=e(k,2),F=w[0],L=w[1],A=o(null),T=e(A,2),C=T[0],E=T[1],G=i({}),I=s(a(r(t.mark((function r(){var e,n,a,o,i,s,u=arguments;return t.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:for(D(!0),r.prev=1,e=u.length,n=new Array(e),a=0;a<e;a++)n[a]=u[a];if(o=JSON.stringify(n),!G.current[o]||!h){r.next=7;break}return L(G.current[o]),r.abrupt("return");case 7:return r.next=9,c.apply(void 0,n);case 9:i=r.sent,s=p(i),L(s),h&&(G.current[o]=s),r.next=19;break;case 15:r.prev=15,r.t0=r.catch(1),E(r.t0),console.error(r.t0);case 19:return r.prev=19,D(!1),r.finish(19);case 22:case"end":return r.stop()}}),r,null,[[1,15,19,22]])}))),500),[p,c,h]);return{isLoading:y,data:F,error:C,loadData:I,setData:L,setIsLoading:D}}export{u as default};
1
+ import r from"@babel/runtime/helpers/asyncToGenerator";import e from"@babel/runtime/helpers/slicedToArray";import t from"@babel/runtime/regenerator";import{identity as n,debounce as a,clone as o}from"lodash";import{useState as i,useRef as s,useCallback as u}from"react";function c(c){var l=c.loadFn,p=c.getDataFromResponseFn,d=void 0===p?n((function(r){return r})):p,f=c.initialLoading,m=void 0===f||f,v=c.initialData,b=void 0===v?null:v,h=c.isCacheEnabled,g=void 0!==h&&h,x=i(m),y=e(x,2),D=y[0],k=y[1],w=i(b),F=e(w,2),L=F[0],A=F[1],T=i(null),C=e(T,2),E=C[0],G=C[1],I=s({}),J=u(a(r(t.mark((function r(){var e,n,a,i,s,u,c=arguments;return t.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:for(k(!0),r.prev=1,e=c.length,n=new Array(e),a=0;a<e;a++)n[a]=c[a];if(i=JSON.stringify(n),!I.current[i]||!g){r.next=7;break}return A(o(I.current[i])),r.abrupt("return");case 7:return r.next=9,l.apply(void 0,n);case 9:s=r.sent,u=d(s),A(u),g&&(I.current[i]=u),r.next=19;break;case 15:r.prev=15,r.t0=r.catch(1),G(r.t0),console.error(r.t0);case 19:return r.prev=19,k(!1),r.finish(19);case 22:case"end":return r.stop()}}),r,null,[[1,15,19,22]])}))),500),[d,l,g]);return{isLoading:D,data:L,error:E,loadData:J,setData:A,setIsLoading:k}}export{c as default};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@corva/ui",
3
- "version": "0.97.0-11",
3
+ "version": "0.97.0-12",
4
4
  "description": "Shared components/utils for Corva ui projects",
5
5
  "keywords": [
6
6
  "corva-ui"