Skip to content

Commit 1f3fc10

Browse files
committed
docs: Add docstrings
1 parent d6181b3 commit 1f3fc10

File tree

10 files changed

+26
-15
lines changed

10 files changed

+26
-15
lines changed

packages/vue/.gitignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
/lib
22
/dist
3-
/ts3.4
43
/index.d.ts
54
node_modules
65
.DS_Store

packages/vue/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ Schema driven. Zero updater functions.
3131
## Installation
3232

3333
```bash
34-
npm install --save @data-client/vue @data-client/rest @data-client/test
34+
npm install --save @data-client/vue @data-client/rest
3535
```
3636

3737
For more details, see [the Installation docs page](https://dataclient.io/docs/getting-started/installation).

packages/vue/package.json

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@data-client/vue",
3-
"version": "0.1.0",
3+
"version": "0.3.1",
44
"description": "Async State Management without the Management. REST, GraphQL, SSE, Websockets, Fetch",
55
"homepage": "https://dataclient.io",
66
"repository": {
@@ -68,13 +68,12 @@
6868
},
6969
"type": "module",
7070
"engines": {
71-
"node": "^12.17 || ^13.7 || >=14"
71+
"node": ">=14"
7272
},
7373
"files": [
7474
"src",
7575
"dist",
7676
"lib",
77-
"ts3.4",
7877
"node.mjs",
7978
"LICENSE",
8079
"README.md",
@@ -87,7 +86,6 @@
8786
"build:js:browser": "BROWSERSLIST_ENV=legacy yarn g:rollup",
8887
"build:bundle": "yarn g:runs build:js:\\* && echo '{\"type\":\"commonjs\"}' > dist/package.json",
8988
"build:clean": "yarn g:clean index.d.ts",
90-
"build:legacy-types": "yarn g:downtypes lib ts3.4",
9189
"build": "run build:lib && run build:bundle",
9290
"dev": "run build:lib -w",
9391
"prepare": "run build:lib",
@@ -102,11 +100,15 @@
102100
},
103101
"peerDependencies": {
104102
"@types/vue": "^3.0.0",
103+
"@vue/test-utils": "^2.4.0",
105104
"vue": "^3.0.0"
106105
},
107106
"peerDependenciesMeta": {
108107
"@types/vue": {
109108
"optional": true
109+
},
110+
"@vue/test-utils": {
111+
"optional": true
110112
}
111113
},
112114
"devDependencies": {

packages/vue/src/consumers/useCache.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ import type {
1717
/**
1818
* Read an Endpoint's response if it is ready.
1919
*
20-
* `useCache` guarantees referential equality globally.
20+
* `useCache` is globally memoized.
2121
* @see https://dataclient.io/docs/api/useCache
2222
*/
2323
export default function useCache<

packages/vue/src/consumers/useFetch.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,6 @@ import type {
1616

1717
/**
1818
* Fetch an Endpoint if it is not in cache or stale.
19-
* Non-suspense; returns the fetch Promise when a request is issued, otherwise undefined.
20-
* Mirrors React useFetch semantics.
2119
* @see https://dataclient.io/docs/api/useFetch
2220
*/
2321
export default function useFetch<

packages/vue/src/consumers/useQuery.ts

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,9 @@ import { useController, injectState } from '../context.js';
99
import type { MaybeRefsOrGetters } from '../types.js';
1010

1111
/**
12-
* Query the store (non-suspense).
12+
* Query the store.
1313
*
14-
* Returns a readonly computed ref of the query result. The value is undefined when
15-
* the result is not found or invalid.
16-
* Mirrors React's useQuery semantics using Vue reactivity.
14+
* `useQuery` results are globally memoized.
1715
* @see https://dataclient.io/docs/api/useQuery
1816
*/
1917
export default function useQuery<S extends Queryable>(

packages/vue/src/consumers/useSuspense.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,14 @@ import type {
2222
MaybeRefsOrGettersNullable,
2323
} from '../types.js';
2424

25+
/**
26+
* Ensure an endpoint is available.
27+
* Suspends until it is.
28+
*
29+
* @see https://dataclient.io/docs/api/useSuspense
30+
* @throws {Promise} If data is not yet available.
31+
* @throws {NetworkError} If fetch fails.
32+
*/
2533
export default function useSuspense<
2634
E extends EndpointInterface<
2735
FetchFunction,

packages/vue/src/providers/getDefaultManagers.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,10 @@ import {
77
} from '@data-client/core';
88

99
/* istanbul ignore next */
10-
/** Returns the default Managers used by DataProvider. */
10+
/** Returns the default Managers used by DataProvider.
11+
*
12+
* @see https://dataclient.io/docs/api/getDefaultManagers
13+
*/
1114
let getDefaultManagers: (options?: GetManagersOptions) => Manager[] = (
1215
options = {},
1316
) => {

packages/vue/src/test/renderDataCompose.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@ import {
99

1010
/**
1111
* Renders a Vue composable with DataClient provider for testing
12-
* Similar to renderDataHook from @data-client/test but for Vue composables
1312
*
13+
* @see https://dataclient.io/docs/api/renderDataCompose
1414
* @param composable - The composable function to test
1515
* @param options - Configuration including optional reactive props ref, fixtures, managers, etc.
1616
*/

yarn.lock

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3499,10 +3499,13 @@ __metadata:
34993499
vue: "npm:^3.4.0"
35003500
peerDependencies:
35013501
"@types/vue": ^3.0.0
3502+
"@vue/test-utils": ^2.4.0
35023503
vue: ^3.0.0
35033504
peerDependenciesMeta:
35043505
"@types/vue":
35053506
optional: true
3507+
"@vue/test-utils":
3508+
optional: true
35063509
languageName: unknown
35073510
linkType: soft
35083511

0 commit comments

Comments
 (0)