@teleporthq/react-components
Advanced tools
Comparing version 1.0.3 to 1.0.4
@@ -20,6 +20,8 @@ import y from "dayjs"; | ||
persistDataDuringLoading: s = !1, | ||
renderLoading: c, | ||
renderSuccess: u, | ||
renderError: l | ||
} = t, [h, i] = d("idle"), [o, g] = d(a), [F, v] = d(null), D = f(t.initialData !== void 0), p = f(s); | ||
renderLoading: l = () => null, | ||
renderSuccess: c, | ||
renderError: u = () => null | ||
} = t, [h, i] = d("idle"), [o, g] = d(a), [F, v] = d(null), D = f( | ||
t.initialData !== void 0 | ||
), p = f(s); | ||
switch (p.current = s, E(() => { | ||
@@ -42,7 +44,7 @@ if (D.current) { | ||
case "loading": | ||
return t.persistDataDuringLoading && o ? u(o, !0) : c ? c() : null; | ||
return t.persistDataDuringLoading && o ? c(o, !0) : l(); | ||
case "success": | ||
return u(o, !1); | ||
return c(o, !1); | ||
case "error": | ||
return l(F); | ||
return u(F); | ||
default: | ||
@@ -54,9 +56,8 @@ return null; | ||
if ("data" in e && "meta" in e) { | ||
const { data: s, meta: c } = e; | ||
const { data: s, meta: l } = e; | ||
return s.length === 0 ? a ? a() : null : /* @__PURE__ */ r.createElement(r.Fragment, null, s.map( | ||
(u, l) => n(typeof u == "object" ? { ...u, teleportMeta: c } : u, l) | ||
(c, u) => n(typeof c == "object" ? { ...c, teleportMeta: l } : c, u) | ||
)); | ||
} | ||
if (Array.isArray(e)) | ||
return e.length === 0 ? a ? a() : null : /* @__PURE__ */ r.createElement(r.Fragment, null, e.map((s, c) => n(s, c))); | ||
return Array.isArray(e) ? e.length === 0 ? a ? a() : null : /* @__PURE__ */ r.createElement(r.Fragment, null, e.map((s, l) => n(s, l))) : null; | ||
}, L = ({ src: t, description: e }) => /* @__PURE__ */ r.createElement(r.Fragment, null, t && /* @__PURE__ */ r.createElement( | ||
@@ -63,0 +64,0 @@ "img", |
{ | ||
"name": "@teleporthq/react-components", | ||
"version": "1.0.3", | ||
"version": "1.0.4", | ||
"description": "", | ||
@@ -5,0 +5,0 @@ "main": "dist/react-components.js", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
120062
506