Skip to content

Commit

Permalink
docs: add note about using provide for default store
Browse files Browse the repository at this point in the history
  • Loading branch information
nickmessing committed Jul 27, 2024
1 parent 628456a commit 297133c
Show file tree
Hide file tree
Showing 5 changed files with 29 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ const isDefaultStoreSelected = defineModel({
:aria-checked="isDefaultStoreSelected"
@click="isDefaultStoreSelected = !isDefaultStoreSelected"
/>
<span class="store-style-custom">Multiple</span>
<span class="store-style-custom">Argument</span>
</div>
</div>
</template>
Expand Down
7 changes: 7 additions & 0 deletions packages/private/docs/api/checkpoints/composables.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,13 @@

Checkpoints composables.

<div class="hide-custom-store">

> [!NOTE]
> To use these composables with the "default" [Checkpoints](https://tinybase.org/api/checkpoints/interfaces/checkpoints/checkpoints/) object, you need to have the object provided with the [`provideCheckpoints`](/api/checkpoints/context#provide-checkpoints) function in a parent component. We recommend providing the store in the `createApp` call just like the `provideStore` is used in the [example in the guide](/guide/getting-started/connect-to-vuejs-app#provide-the-store-to-your-vue-app).
</div>

## useCheckpoint {#use-checkpoint}

The `useCheckpoint` composable returns the label for a checkpoint, and registers a listener so that any changes to that result will cause a re-render.
Expand Down
7 changes: 7 additions & 0 deletions packages/private/docs/api/store/composables.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,13 @@

Store's composables.

<div class="hide-custom-store">

> [!NOTE]
> To use these composables with the "default" store, you need to have the store provided with the [`provideStore`](/api/store/context#provide-store) function in a parent component. We recommend providing the store in the `createApp` call just like the [example in the guide](/guide/getting-started/connect-to-vuejs-app#provide-the-store-to-your-vue-app).
</div>

## useCell {#use-cell}

The `useCell` composable returns a **readonly** reference to an object containing the value of a single [Cell](https://tinybase.org/api/store/type-aliases/store/cell/) in a given [Row](https://tinybase.org/api/store/type-aliases/store/row/), in a given [Table](https://tinybase.org/api/store/type-aliases/store/table/), and registers a listener so that any changes to that result will cause a re-render.
Expand Down
7 changes: 7 additions & 0 deletions packages/private/docs/api/store/events.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,13 @@

Store's event hooks.

<div class="hide-custom-store">

> [!NOTE]
> To use these event hooks with the "default" store, you need to have the store provided with the [`provideStore`](/api/store/context#provide-store) function in a parent component. We recommend providing the store in the `createApp` call just like the [example in the guide](/guide/getting-started/connect-to-vuejs-app#provide-the-store-to-your-vue-app).
</div>

## onCellChange {#on-cell-change}

The `onCellChange` event hook registers a listener function with a [Store](https://tinybase.org/api/store/interfaces/store/store/) that will be called whenever data in a [Cell](https://tinybase.org/api/store/type-aliases/store/cell/) changes.
Expand Down
7 changes: 7 additions & 0 deletions packages/private/docs/api/store/references.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,13 @@

Store's references.

<div class="hide-custom-store">

> [!NOTE]
> To use these references with the "default" store, you need to have the store provided with the [`provideStore`](/api/store/context#provide-store) function in a parent component. We recommend providing the store in the `createApp` call just like the [example in the guide](/guide/getting-started/connect-to-vuejs-app#provide-the-store-to-your-vue-app).
</div>

> [!IMPORTANT]
> The references are not deep-reactive, you have to assign a new value to the reference when you want to update the data.
Expand Down

0 comments on commit 297133c

Please sign in to comment.