# Once

`import { Once } from "destack:sync";`

One-time execution state.

```ds title="Once"
export class Once {
    state: Atomic<uint32>;
    call(body: () => void): void;
    isCompleted(): boolean;
}
```

[language/library/src/sync/once.ds:7:20](https://github.com/destack-sh/destack/blob/main/language/library/src/sync/once.ds#L7-L20)

## Members

### `state: Atomic<uint32>`

The execution state.

### `call(body: () => void): void`

Run `body` once.

### `isCompleted(): boolean`

Return true after the body has completed.
