@triplit/svelte 0.1.38 → 0.1.40

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/CHANGELOG.md CHANGED
@@ -1,5 +1,20 @@
1
1
  # @triplit/svelte
2
2
 
3
+ ## 0.1.40
4
+
5
+ ### Patch Changes
6
+
7
+ - 7279628: add JSDoc comments
8
+ - Updated dependencies [20b8bca]
9
+ - @triplit/client@0.3.68
10
+
11
+ ## 0.1.39
12
+
13
+ ### Patch Changes
14
+
15
+ - Updated dependencies [6914e65]
16
+ - @triplit/client@0.3.67
17
+
3
18
  ## 0.1.38
4
19
 
5
20
  ### Patch Changes
@@ -1,5 +1,13 @@
1
1
  import type { ClientFetchResult, ClientQuery, ClientQueryBuilder, Models, SubscriptionOptions, TriplitClient, Unalias } from '@triplit/client';
2
2
  import { WorkerClient } from '@triplit/client/worker-client';
3
+ /**
4
+ * A hook that subscribes to a query
5
+ *
6
+ * @param client - The client instance to query with
7
+ * @param query - The query to subscribe to
8
+ * @param options - Additional options for the subscription
9
+ * @returns An object containing the fetching state, the result of the query, any error that occurred, and a function to update the query
10
+ */
3
11
  export declare function useQuery<M extends Models<any, any> | undefined, Q extends ClientQuery<M, any, any, any>>(client: TriplitClient<any> | WorkerClient<any>, query: ClientQueryBuilder<Q>, options?: Partial<SubscriptionOptions>): {
4
12
  fetching: boolean;
5
13
  fetchingLocal: boolean;
@@ -8,6 +16,12 @@ export declare function useQuery<M extends Models<any, any> | undefined, Q exten
8
16
  error: any;
9
17
  updateQuery: (query: ClientQueryBuilder<Q>) => void;
10
18
  };
19
+ /**
20
+ * A hook that subscribes to the connection status of a client with the server
21
+ *
22
+ * @param client - The client instance to get the connection status of
23
+ * @returns An object containing `status`, the current connection status of the client with the server
24
+ */
11
25
  export declare function useConnectionStatus(client: TriplitClient<any> | WorkerClient<any>): {
12
26
  readonly status: string;
13
27
  };
@@ -1,4 +1,12 @@
1
1
  /// <reference types="svelte" />
2
+ /**
3
+ * A hook that subscribes to a query
4
+ *
5
+ * @param client - The client instance to query with
6
+ * @param query - The query to subscribe to
7
+ * @param options - Additional options for the subscription
8
+ * @returns An object containing the fetching state, the result of the query, any error that occurred, and a function to update the query
9
+ */
2
10
  export function useQuery(client, query, options) {
3
11
  let results = $state(undefined);
4
12
  let isInitialFetch = $state(true);
@@ -72,6 +80,12 @@ export function useQuery(client, query, options) {
72
80
  updateQuery,
73
81
  };
74
82
  }
83
+ /**
84
+ * A hook that subscribes to the connection status of a client with the server
85
+ *
86
+ * @param client - The client instance to get the connection status of
87
+ * @returns An object containing `status`, the current connection status of the client with the server
88
+ */
75
89
  export function useConnectionStatus(client) {
76
90
  let status = $state('CONNECTING');
77
91
  $effect(() => {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@triplit/svelte",
3
3
  "packageManager": "yarn@3.4.1",
4
- "version": "0.1.38",
4
+ "version": "0.1.40",
5
5
  "source": "./src/index.svelte.ts",
6
6
  "main": "./dist/index.svelte.js",
7
7
  "module": "./dist/index.svelte.js",
@@ -28,7 +28,7 @@
28
28
  "/dist"
29
29
  ],
30
30
  "dependencies": {
31
- "@triplit/client": "^0.3.66"
31
+ "@triplit/client": "^0.3.68"
32
32
  },
33
33
  "devDependencies": {
34
34
  "@sveltejs/package": "^2.3.0",