You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: packages/private/docs/api/checkpoints/composables.md
+79-4
Original file line number
Diff line number
Diff line change
@@ -1,6 +1,6 @@
1
1
# Composables {#composables}
2
2
3
-
Checkpoinnts composables.
3
+
Checkpoints composables.
4
4
5
5
## useCheckpoint {#use-checkpoint}
6
6
@@ -20,15 +20,15 @@ When first accessed, this composable will create a listener so that changes to t
20
20
21
21
### Returns
22
22
23
-
-`ComputedRef<string | undefined>`: A **readonly** reference to the string label for the requested checkpoint, an empty string if it was never set, or `undefined` if the checkpoint does not exist..
23
+
-`ComputedRef<string | undefined>`: A **readonly** reference to the string label for the requested checkpoint, an empty string if it was never set, or `undefined` if the checkpoint does not exist.
24
24
25
25
### Example
26
26
27
27
<divclass="hide-default-store">
28
28
29
29
```vue
30
30
<script setup lang="ts">
31
-
import { useCell, injectStore, useCheckpoint } from 'vue-tinybase/custom-store'
31
+
import { injectStore, injectCheckpoints, useCheckpoint } from 'vue-tinybase/custom-store'
32
32
33
33
import { Store1Key, Checkpoints1Key } from './store'
The `useCheckpointIds` composable returns an array of the checkpoint [Ids](https://tinybase.org/api/common/type-aliases/identity/ids/) being managed by this [Checkpoints](https://tinybase.org/api/checkpoints/interfaces/checkpoints/checkpoints/) object, and registers a listener so that any changes to that result will cause a re-render.
81
+
82
+
When first accessed, this composable will create a listener so that changes to the checkpoint [Ids](https://tinybase.org/api/common/type-aliases/identity/ids/) will cause a re-render. When the component containing this composable is unmounted, the listener will be automatically removed.
83
+
84
+
<divclass="hide-default-store">
85
+
86
+
### Parameters
87
+
88
+
-`checkpoints` ([`Checkpoints`](https://tinybase.org/api/checkpoints/interfaces/checkpoints/checkpoints/)): The [`Checkpoints`](https://tinybase.org/api/checkpoints/interfaces/checkpoints/checkpoints/) object to be accessed.
89
+
90
+
</div>
91
+
92
+
### Returns
93
+
94
+
-`ComputedRef<`[`CheckpointIds`](https://tinybase.org/api/checkpoints/type-aliases/identity/checkpointids/)`>`: A **readonly** reference to the [CheckpointIds](https://tinybase.org/api/checkpoints/type-aliases/identity/checkpointids/) array, containing the checkpoint [Ids](https://tinybase.org/api/common/type-aliases/identity/ids/) managed by this [Checkpoints](https://tinybase.org/api/checkpoints/interfaces/checkpoints/checkpoints/) object.
95
+
96
+
### Example
97
+
98
+
<divclass="hide-default-store">
99
+
100
+
```vue
101
+
<script setup lang="ts">
102
+
import { injectStore, injectCheckpoints, useCheckpointIds } from 'vue-tinybase/custom-store'
103
+
104
+
import { Store1Key, Checkpoints1Key } from './store'
0 commit comments