@opendaw/lib-jsx 0.0.25 → 0.0.26

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,4 +1,4 @@
1
- import { Exec, Func, Provider } from "@opendaw/lib-std";
1
+ import { Exec, Func, Procedure, Provider } from "@opendaw/lib-std";
2
2
  import { DomElement, JsxValue } from "../types";
3
3
  export type AwaitProps<T> = {
4
4
  factory: Provider<Promise<T>>;
@@ -8,6 +8,7 @@ export type AwaitProps<T> = {
8
8
  reason: any;
9
9
  retry: Exec;
10
10
  }, JsxValue>;
11
+ repeat?: Procedure<Exec>;
11
12
  };
12
- export declare const Await: <T>({ factory, loading, success, failure }: AwaitProps<T>) => DomElement;
13
+ export declare const Await: <T>({ factory, loading, success, failure, repeat }: AwaitProps<T>) => DomElement;
13
14
  //# sourceMappingURL=Await.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"Await.d.ts","sourceRoot":"","sources":["../../src/std/Await.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAC,IAAI,EAAE,IAAI,EAAE,QAAQ,EAAC,MAAM,kBAAkB,CAAA;AAErD,OAAO,EAAC,UAAU,EAAE,QAAQ,EAAC,MAAM,UAAU,CAAA;AAE7C,MAAM,MAAM,UAAU,CAAC,CAAC,IAAI;IACxB,OAAO,EAAE,QAAQ,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC;IAC9B,OAAO,EAAE,QAAQ,CAAC,QAAQ,CAAC,CAAC;IAC5B,OAAO,EAAE,IAAI,CAAC,CAAC,EAAE,QAAQ,CAAC,CAAC;IAC3B,OAAO,EAAE,IAAI,CAAC;QAAE,MAAM,EAAE,GAAG,CAAC;QAAC,KAAK,EAAE,IAAI,CAAA;KAAE,EAAE,QAAQ,CAAC,CAAA;CACxD,CAAA;AAED,eAAO,MAAM,KAAK,GAAI,CAAC,EAAI,wCAAsC,UAAU,CAAC,CAAC,CAAC,eAU7E,CAAA"}
1
+ {"version":3,"file":"Await.d.ts","sourceRoot":"","sources":["../../src/std/Await.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAC,IAAI,EAAE,IAAI,EAAE,SAAS,EAAE,QAAQ,EAAc,MAAM,kBAAkB,CAAA;AAE7E,OAAO,EAAC,UAAU,EAAE,QAAQ,EAAC,MAAM,UAAU,CAAA;AAE7C,MAAM,MAAM,UAAU,CAAC,CAAC,IAAI;IACxB,OAAO,EAAE,QAAQ,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC;IAC9B,OAAO,EAAE,QAAQ,CAAC,QAAQ,CAAC,CAAC;IAC5B,OAAO,EAAE,IAAI,CAAC,CAAC,EAAE,QAAQ,CAAC,CAAC;IAC3B,OAAO,EAAE,IAAI,CAAC;QAAE,MAAM,EAAE,GAAG,CAAC;QAAC,KAAK,EAAE,IAAI,CAAA;KAAE,EAAE,QAAQ,CAAC,CAAA;IACrD,MAAM,CAAC,EAAE,SAAS,CAAC,IAAI,CAAC,CAAA;CAC3B,CAAA;AAED,eAAO,MAAM,KAAK,GAAI,CAAC,EAAI,gDAA8C,UAAU,CAAC,CAAC,CAAC,eAWrF,CAAA"}
package/dist/std/Await.js CHANGED
@@ -1,10 +1,12 @@
1
+ import { safeExecute } from "@opendaw/lib-std";
1
2
  import { createElement, replaceChildren } from "../create-element";
2
- export const Await = ({ factory, loading, success, failure }) => {
3
+ export const Await = ({ factory, loading, success, failure, repeat }) => {
3
4
  const contents = createElement("div", { style: { display: "contents" } });
4
5
  const start = () => {
5
6
  replaceChildren(contents, loading());
6
7
  factory().then(result => replaceChildren(contents, success(result)), reason => replaceChildren(contents, failure({ reason, retry: () => start() })));
7
8
  };
8
9
  start();
10
+ safeExecute(repeat, start);
9
11
  return contents;
10
12
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@opendaw/lib-jsx",
3
- "version": "0.0.25",
3
+ "version": "0.0.26",
4
4
  "license": "LGPL-3.0-or-later",
5
5
  "main": "./dist/index.js",
6
6
  "types": "./dist/index.d.ts",
@@ -22,12 +22,12 @@
22
22
  "test": "echo \"No tests to run\""
23
23
  },
24
24
  "dependencies": {
25
- "@opendaw/lib-dom": "^0.0.25",
26
- "@opendaw/lib-std": "^0.0.25"
25
+ "@opendaw/lib-dom": "^0.0.26",
26
+ "@opendaw/lib-std": "^0.0.26"
27
27
  },
28
28
  "devDependencies": {
29
29
  "@opendaw/eslint-config": "^0.0.18",
30
30
  "@opendaw/typescript-config": "^0.0.19"
31
31
  },
32
- "gitHead": "3d8d12f0591ea2182072dcb77b6f34c97b18a7ff"
32
+ "gitHead": "8ae54e26d0349a928fc5dbeae90190d76904167a"
33
33
  }