Skip to content

IDataAdapter

Defined in: store/adapters/DataAdapter.ts:39

Type Parameters

D extends DataSchema = DataSchema

Properties

onDataChange

onDataChange: Signal<(detail) => void>

Defined in: store/adapters/DataAdapter.ts:111

Emits a signal when data changes.

Methods

append()

append<K>(key, value, separator?): D[K]

Defined in: store/adapters/DataAdapter.ts:92

Appends a string to a string property.

Type Parameters

K extends string | number | symbol

Parameters

key

K

The key of the string property

value

string

The string to append

separator?

string

The separator to use (default: ”)

Returns

D[K]

The new string after concatenation


clear()

Call Signature

clear(): void

Defined in: store/adapters/DataAdapter.ts:59

Clears all data from storage.

Returns

void

Call Signature

clear<K>(key): void

Defined in: store/adapters/DataAdapter.ts:64

Clears data for a specific key from storage.

Type Parameters

K extends string | number | symbol

Parameters
key

K

The key from which to delete the data

Returns

void


concat()

concat<K>(key, value): D[K]

Defined in: store/adapters/DataAdapter.ts:81

Concatenates a value or array of values to an array property.

Type Parameters

K extends string | number | symbol

Parameters

key

K

The key of the array property

value

D[K] extends E[] ? E | E[] : never

The value(s) to concatenate

Returns

D[K]

The new array after concatenation


get()

Call Signature

get(): D

Defined in: store/adapters/DataAdapter.ts:40

Returns

D

Call Signature

get<K>(key): undefined | D[K]

Defined in: store/adapters/DataAdapter.ts:41

Type Parameters

K extends string | number | symbol

Parameters
key

K

Returns

undefined | D[K]


increment()

increment<K>(key, amount?): D[K]

Defined in: store/adapters/DataAdapter.ts:71

Increments a numeric property by a specified amount.

Type Parameters

K extends string | number | symbol

Parameters

key

K

The key of the property to increment

amount?

number

The amount to increment by (default: 1)

Returns

D[K]

The new value after incrementing


set()

Call Signature

set<K>(key, data): D

Defined in: store/adapters/DataAdapter.ts:48

Sets data for a specific key in storage.

Type Parameters

K extends string | number | symbol

Parameters
key

K

The key under which to save the data

data

D[K]

The data to save

Returns

D

The updated data object

Call Signature

set(data, merge?): D

Defined in: store/adapters/DataAdapter.ts:55

Merges data into storage.

Parameters
data

DeepPartial<D>

The data object to set

merge?

boolean

Whether to merge with existing data

Returns

D

The updated data object


snapshot()

Call Signature

snapshot(): D

Defined in: store/adapters/DataAdapter.ts:101

Returns a snapshot of the current data.

Returns

D

A snapshot of the current data

Call Signature

snapshot<K>(key?): D[K]

Defined in: store/adapters/DataAdapter.ts:107

Returns a snapshot of the current data for a specific key.

Type Parameters

K extends string | number | symbol

Parameters
key?

K

The key of the data to snapshot

Returns

D[K]

A snapshot of the current data for the specified key