@evolu/web 3.0.1 → 3.0.2

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.
@@ -13,16 +13,26 @@ import { type DisposableRun, type RunCustomDeps } from "@evolu/common";
13
13
  * ### Example
14
14
  *
15
15
  * ```ts
16
+ * import {
17
+ * createConsole,
18
+ * createConsoleFormatter,
19
+ * ok,
20
+ * } from "@evolu/common";
21
+ * import { createRun } from "@evolu/web";
22
+ *
16
23
  * const console = createConsole({
17
24
  * formatter: createConsoleFormatter()({
18
25
  * timestampFormat: "relative",
19
26
  * }),
20
27
  * });
21
28
  *
22
- * const run = createRun({ console });
23
- * const appPromise = run.ok(startApp());
29
+ * await using run = createRun({ console });
30
+ * const appPromise = run.ok(() => ok("started"));
31
+ *
32
+ * expect(await appPromise).toBe("started");
24
33
  * ```
25
34
  */
26
35
  export declare function createRun(): DisposableRun;
36
+ /** Creates a root {@link Run} for the browser with custom dependencies. */
27
37
  export declare function createRun<D extends object>(deps: RunCustomDeps<D>): DisposableRun<D>;
28
38
  //# sourceMappingURL=Task.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"Task.d.ts","sourceRoot":"","sources":["../../src/Task.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAEL,KAAK,aAAa,EAElB,KAAK,aAAa,EACnB,MAAM,eAAe,CAAC;AAEvB;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAgB,SAAS,IAAI,aAAa,CAAC;AAC3C,wBAAgB,SAAS,CAAC,CAAC,SAAS,MAAM,EACxC,IAAI,EAAE,aAAa,CAAC,CAAC,CAAC,GACrB,aAAa,CAAC,CAAC,CAAC,CAAC"}
1
+ {"version":3,"file":"Task.d.ts","sourceRoot":"","sources":["../../src/Task.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAEL,KAAK,aAAa,EAElB,KAAK,aAAa,EACnB,MAAM,eAAe,CAAC;AAEvB;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AACH,wBAAgB,SAAS,IAAI,aAAa,CAAC;AAE3C,2EAA2E;AAC3E,wBAAgB,SAAS,CAAC,CAAC,SAAS,MAAM,EACxC,IAAI,EAAE,aAAa,CAAC,CAAC,CAAC,GACrB,aAAa,CAAC,CAAC,CAAC,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@evolu/web",
3
- "version": "3.0.1",
3
+ "version": "3.0.2",
4
4
  "description": "Evolu for web",
5
5
  "keywords": [
6
6
  "evolu",
@@ -40,7 +40,7 @@
40
40
  "@types/web-locks-api": "^0.0.5",
41
41
  "@typescript/native": "npm:typescript@^7.0.2",
42
42
  "user-agent-data-types": "^0.4.2",
43
- "@evolu/common": "8.1.0",
43
+ "@evolu/common": "8.3.0",
44
44
  "@evolu/typescript-config": "0.0.2"
45
45
  },
46
46
  "peerDependencies": {
package/src/Task.ts CHANGED
@@ -20,17 +20,28 @@ import {
20
20
  * ### Example
21
21
  *
22
22
  * ```ts
23
+ * import {
24
+ * createConsole,
25
+ * createConsoleFormatter,
26
+ * ok,
27
+ * } from "@evolu/common";
28
+ * import { createRun } from "@evolu/web";
29
+ *
23
30
  * const console = createConsole({
24
31
  * formatter: createConsoleFormatter()({
25
32
  * timestampFormat: "relative",
26
33
  * }),
27
34
  * });
28
35
  *
29
- * const run = createRun({ console });
30
- * const appPromise = run.ok(startApp());
36
+ * await using run = createRun({ console });
37
+ * const appPromise = run.ok(() => ok("started"));
38
+ *
39
+ * expect(await appPromise).toBe("started");
31
40
  * ```
32
41
  */
33
42
  export function createRun(): DisposableRun;
43
+
44
+ /** Creates a root {@link Run} for the browser with custom dependencies. */
34
45
  export function createRun<D extends object>(
35
46
  deps: RunCustomDeps<D>,
36
47
  ): DisposableRun<D>;