Skip to content

How to use composables

  1. Install the library:
shell
npm i @gun-vue/composables
  1. Import any of the functions you need:
js
import { useAccount } from "@gun-vue/composables";
  1. Instantiate the function inside your Vue SFC
js
const { account, auth, leave } = useAccount();
  1. Use the reactive state in your template to drive the component:
html
<div v-for="(data,field) in account.profile" :key="field">
	{{ field }} - {{ data }}
</div>

MIT