[API reference](https://evolu.dev/docs/api-reference) › [@evolu/vue](https://evolu.dev/docs/api-reference/vue) › useStore

```ts
function useStore<T>(store: ReadonlyStore<T>): Readonly<Ref<T>>;
```

Defined in: [useStore.ts:35](https://github.com/evoluhq/evolu/blob/aa223771feea747ffb1b0f5f3271574455633e37/packages/vue/src/useStore.ts#L35)

Vue composable returning the value of an Evolu [ReadonlyStore](https://evolu.dev/docs/api-reference/common/Store/interfaces/ReadonlyStore), such as
`evoluError` or `syncState` of the deps, in a ref that follows the store
until the current effect scope, such as the component, is disposed. It's what
React's `useSyncExternalStore` does for a store. A store replaces its value
rather than mutating it, so the ref changes only when the value does. During
server rendering, it reads the store once.

### Example

```ts
import { assertType, type ReadonlyStore, type SyncState } from "@evolu/common";
import { useStore } from "@evolu/vue";
import type { Ref } from "vue";

// Call composables in component setup.
const useSyncState = (syncState: ReadonlyStore<SyncState | null>) =>
  useStore(syncState);

assertType<ReturnType<typeof useSyncState>, Readonly<Ref<SyncState | null>>>();
```