# SettingsStore

Remembers settings. Implementations never throw, even when storage is
blocked; they fall back to memory and report `persistent: false` so the
ui can say changes will not be remembered.

This is an interface exported by `@mapcairn/core`, checked against version 0.2.0.

## Signature

```ts
import type { SettingsStore } from "@mapcairn/core";
 
interface SettingsStore
```

## Properties

### persistent

```ts
readonly persistent: boolean;
```

False when changes will be lost on reload.

## Methods

### get

```ts
get(): Settings;
```

The current settings. The same object is returned until something changes.

### set

```ts
set(patch: Partial<Settings>): void;
```

Merges the patch into the settings. A property whose value is `undefined` is ignored, and a change that alters nothing notifies nobody.

- `patch` (`Partial<Settings>`)

### subscribe

```ts
subscribe(listener: (settings: Settings) => void): () => void;
```

Calls the listener after a change. Returns the function that unsubscribes.

- `listener` (`(settings: Settings) => void`)

## See also

- [`Settings`](https://docs.mapcairn.com/api/core/Settings.md)

Source: [packages/core/src/ports/settings.ts:60](https://github.com/MapCairn/mapcairn/blob/main/packages/core/src/ports/settings.ts#L60)
