Skip to content

vue

import {
  useStore
} from "exome/vue";

function useStore

Subscribes to store instance update events and trigger updates to component accordingly.

function useStore<T extends Exome>(store: T): Readonly<T>;
example.vue
<script lang="ts" setup>
  import { useStore } from "exome/vue"
  import { counterStore } from "./counter.store.ts"
 
  const { count, increment } = useStore(counterStore)
</script>
 
<template>
  <button @click="increment()">{{ count }}</button>
</template>