@sortsys/ui 0.1.35 → 0.1.36

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.
package/dist/dev.js CHANGED
@@ -140,9 +140,9 @@ var _tmpl$11 = /* @__PURE__ */ template(`<tr>`);
140
140
  var _tmpl$12 = /* @__PURE__ */ template(`<td>`);
141
141
  function _SSDataCell(props) {
142
142
  const rendered = createMemo(() => props.render(props.row));
143
- const [asyncContent] = createResource(async () => {
144
- const value = rendered();
145
- if (value && typeof value.then === "function") {
143
+ const isPromise = (value) => !!value && typeof value.then === "function";
144
+ const [asyncContent] = createResource(rendered, async (value) => {
145
+ if (isPromise(value)) {
146
146
  return await value;
147
147
  }
148
148
  return null;
@@ -151,7 +151,7 @@ function _SSDataCell(props) {
151
151
  var _el$ = _tmpl$5();
152
152
  insert(_el$, () => {
153
153
  const value = rendered();
154
- if (value && typeof value.then === "function") {
154
+ if (isPromise(value)) {
155
155
  return asyncContent() ?? "";
156
156
  }
157
157
  return value;
package/dist/index.js CHANGED
@@ -140,9 +140,9 @@ var _tmpl$11 = /* @__PURE__ */ template(`<tr>`);
140
140
  var _tmpl$12 = /* @__PURE__ */ template(`<td>`);
141
141
  function _SSDataCell(props) {
142
142
  const rendered = createMemo(() => props.render(props.row));
143
- const [asyncContent] = createResource(async () => {
144
- const value = rendered();
145
- if (value && typeof value.then === "function") {
143
+ const isPromise = (value) => !!value && typeof value.then === "function";
144
+ const [asyncContent] = createResource(rendered, async (value) => {
145
+ if (isPromise(value)) {
146
146
  return await value;
147
147
  }
148
148
  return null;
@@ -151,7 +151,7 @@ function _SSDataCell(props) {
151
151
  var _el$ = _tmpl$5();
152
152
  insert(_el$, () => {
153
153
  const value = rendered();
154
- if (value && typeof value.then === "function") {
154
+ if (isPromise(value)) {
155
155
  return asyncContent() ?? "";
156
156
  }
157
157
  return value;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sortsys/ui",
3
- "version": "0.1.35",
3
+ "version": "0.1.36",
4
4
  "description": "Simple and beautiful UI library for sortsys",
5
5
  "license": "MIT",
6
6
  "author": "Ludwig Lehnert",