[**Documentation**](../../../../README)

***

[Documentation](../../../../README) / [@zerotal/flow](../../README) / [index](../README) / SharedStore

# Interface: SharedStore

Defined in: [flow/src/shared.ts:39](https://github.com/zerotaldev/zerotal/blob/1d6fb26b05b18ba077de1bfaeb46c42131cd8b70/packages/flow/src/shared.ts#L39)

Pluggable backing store for `@shared` room state — the canonical, per-channel
value that all subscribers converge on.

## Remarks

Keys are of the form `channel::prop`. Stored values are already deep-cloned by
the caller, so the store may hold references without aliasing component state.
The default is an in-process MemorySharedStore; swap a distributed
implementation (e.g. Redis-backed) via [setSharedStore](../functions/setSharedStore) to converge
across processes. Implement all three methods synchronously.

## Methods

### get()

> **get**(`key`): `unknown`

Defined in: [flow/src/shared.ts:41](https://github.com/zerotaldev/zerotal/blob/1d6fb26b05b18ba077de1bfaeb46c42131cd8b70/packages/flow/src/shared.ts#L41)

Read the current value for a `channel::prop` key, or `undefined` if unset.

#### Parameters

##### key

`string`

#### Returns

`unknown`

***

### set()

> **set**(`key`, `value`): `void`

Defined in: [flow/src/shared.ts:43](https://github.com/zerotaldev/zerotal/blob/1d6fb26b05b18ba077de1bfaeb46c42131cd8b70/packages/flow/src/shared.ts#L43)

Write the canonical value for a `channel::prop` key.

#### Parameters

##### key

`string`

##### value

`unknown`

#### Returns

`void`

***

### has()

> **has**(`key`): `boolean`

Defined in: [flow/src/shared.ts:45](https://github.com/zerotaldev/zerotal/blob/1d6fb26b05b18ba077de1bfaeb46c42131cd8b70/packages/flow/src/shared.ts#L45)

Whether a value has been stored for a `channel::prop` key.

#### Parameters

##### key

`string`

#### Returns

`boolean`
