Skip to content

DataAdapter

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

A class representing a storage adapter that uses the local storage.

Extends

Type Parameters

D extends DataSchema = DataSchema

Implements

Constructors

new DataAdapter()

new DataAdapter<D>(id): DataAdapter<D>

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

Parameters

id

string = 'data'

Returns

DataAdapter<D>

Overrides

StorageAdapter.constructor

Properties

__dill_pixel_method_binding_root

__dill_pixel_method_binding_root: boolean

Defined in: plugins/Plugin.ts:37

Inherited from

StorageAdapter.__dill_pixel_method_binding_root


data

data: D

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


id

readonly id: string = 'data'

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

The ID of the adapter. Default is ‘StorageAdapter’.

Inherited from

StorageAdapter.id


onDataChange

onDataChange: Signal<(detail) => void>

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

Implementation of

IDataAdapter.onDataChange

Accessors

app

Get Signature

get app(): T

Defined in: plugins/Plugin.ts:45

Returns

T

Inherited from

StorageAdapter.app

Methods

addSignalConnection()

addSignalConnection(…args): void

Defined in: plugins/Plugin.ts:71

Add signal connections to the container.

Parameters

args

SignalConnection[]

The signal connections to add.

Returns

void

Inherited from

StorageAdapter.addSignalConnection


clear()

clear<K>(key): void

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

Deletes data from a specified key in the local storage.

Type Parameters

K extends string | number | symbol

Parameters

key

K

The key from which to delete the data.

Returns

void

Implementation of

IDataAdapter.clear


clearSignalConnections()

clearSignalConnections(): void

Defined in: plugins/Plugin.ts:77

Returns

void

Inherited from

StorageAdapter.clearSignalConnections


destroy()

destroy(): void

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

Destroys the adapter.

Returns

void

Overrides

StorageAdapter.destroy


get()

get(): D

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

Returns

D

Implementation of

IDataAdapter.get


getCoreSignals()

getCoreSignals(): string[]

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

Returns

string[]

Overrides

StorageAdapter.getCoreSignals


initialize()

initialize(_app, options?): void

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

Initializes the adapter.

Parameters

_app

IApplication

The application that the adapter belongs to.

options?

Partial<IDataAdapterOptions<D>>

The options to initialize the adapter with.

Returns

void

Overrides

StorageAdapter.initialize


load()

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

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

Loads data from a specified key in the local storage.

Type Parameters

K extends string | number | symbol

Parameters

key

K

The key from which to load the data.

Returns

undefined | D[K]

The loaded data.

Implementation of

IDataAdapter.load

Overrides

StorageAdapter.load


postInitialize()

postInitialize(_app): void | Promise<void>

Defined in: plugins/Plugin.ts:60

Parameters

_app

IApplication

Returns

void | Promise<void>

Inherited from

StorageAdapter.postInitialize


save()

save<K>(key, data): D

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

Saves data under a specified key in the local 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 saved data.

Implementation of

IDataAdapter.save

Overrides

StorageAdapter.save


set()

set(data, merge): D

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

Parameters

data

DeepPartial<D>

merge

boolean = true

Returns

D

Implementation of

IDataAdapter.set