# injectResetAtom

Signature
`injectResetAtom(atom: Atom<any>): () => void`

valdres-angular
Reset an atom to its default value

Returns a function that resets an atom back to its default value.

## Usage

```ts
import { Component } from "@angular/core"
import { atom } from "valdres"
import { injectAtom, injectResetAtom } from "valdres-angular"

const countAtom = atom(0)

@Component({
    selector: "app-counter",
    template: `
        <span>{{ count() }}</span>
        <button (click)="count.update(c => c + 1)">+</button>
        <button (click)="reset()">Reset</button>
    `,
})
export class CounterComponent {
    count = injectAtom(countAtom)
    reset = injectResetAtom(countAtom)
}
```

## See also

- [injectAtom](https://valdres.dev/angular/injectAtom) — read + write signal
- [injectSetAtom](https://valdres.dev/angular/injectSetAtom) — write-only setter
