# useSetAtom

Signature
`useSetAtom<T>(atom: Atom<T>): SetterFn<T>`

valdres-vue
Write-only access to an atom

Returns a setter function for an atom without subscribing to its value. Use this when a component only needs to trigger updates.

## Usage

```vue
<script setup>
import { atom } from "valdres"
import { useSetAtom } from "valdres-vue"

const countAtom = atom(0)
const setCount = useSetAtom(countAtom)
</script>

<template>
    <button @click="setCount(c => c + 1)">+</button>
</template>
```

## See also

- [useAtom](https://valdres.dev/vue/useAtom) — read + write composable
- [useResetAtom](https://valdres.dev/vue/useResetAtom) — reset to default value
