DataAdapter
Defined in: store/adapters/DataAdapter.ts:133
A class representing a storage adapter that uses the local storage.
Extends
Section titled “Extends”Implements
Section titled “Implements”Constructors
Section titled “Constructors”Constructor
Section titled “Constructor”new DataAdapter(
id
):DataAdapter
Defined in: store/adapters/DataAdapter.ts:143
Parameters
Section titled “Parameters”string
= 'data'
Returns
Section titled “Returns”DataAdapter
Overrides
Section titled “Overrides”Properties
Section titled “Properties”data:
DataSchema
Defined in: store/adapters/DataAdapter.ts:134
readonly
id:string
='data'
Defined in: store/adapters/DataAdapter.ts:143
The ID of the adapter. Default is ‘StorageAdapter’.
Inherited from
Section titled “Inherited from”onDataChange
Section titled “onDataChange”onDataChange:
Signal
<(detail
) =>void
>
Defined in: store/adapters/DataAdapter.ts:136
Emits a signal when data changes.
Implementation of
Section titled “Implementation of”Accessors
Section titled “Accessors”Get Signature
Section titled “Get Signature”get app():
Application
Defined in: plugins/Plugin.ts:52
Returns
Section titled “Returns”Inherited from
Section titled “Inherited from”options
Section titled “options”Get Signature
Section titled “Get Signature”get options():
O
Defined in: plugins/Plugin.ts:44
Returns
Section titled “Returns”O
Inherited from
Section titled “Inherited from”Methods
Section titled “Methods”addSignalConnection()
Section titled “addSignalConnection()”addSignalConnection(…
args
):void
Defined in: plugins/Plugin.ts:78
Add signal connections to the container.
Parameters
Section titled “Parameters”…SignalConnection
[]
The signal connections to add.
Returns
Section titled “Returns”void
Inherited from
Section titled “Inherited from”StorageAdapter
.addSignalConnection
append()
Section titled “append()”append<
K
>(key
,value
,separator
):any
Defined in: store/adapters/DataAdapter.ts:276
Appends a string to a string property.
Type Parameters
Section titled “Type Parameters”K
extends string
The type of keys in D where the value is a string
Parameters
Section titled “Parameters”K
The key of the string property
string
The string to append
separator
Section titled “separator”string
= ''
Returns
Section titled “Returns”any
The new string after concatenation
Implementation of
Section titled “Implementation of”clear()
Section titled “clear()”clear():
void
Defined in: store/adapters/DataAdapter.ts:293
Deletes data from a specified key in the local storage.
Returns
Section titled “Returns”void
Implementation of
Section titled “Implementation of”clearSignalConnections()
Section titled “clearSignalConnections()”clearSignalConnections():
void
Defined in: plugins/Plugin.ts:84
Returns
Section titled “Returns”void
Inherited from
Section titled “Inherited from”StorageAdapter
.clearSignalConnections
concat()
Section titled “concat()”concat<
K
>(key
,value
):any
Defined in: store/adapters/DataAdapter.ts:259
Concatenates a value or array of values to an array property.
Type Parameters
Section titled “Type Parameters”K
extends string
The type of keys in D where the value is an array
Parameters
Section titled “Parameters”K
The key of the array property
unknown
The value(s) to concatenate
Returns
Section titled “Returns”any
The new array after concatenation
Implementation of
Section titled “Implementation of”destroy()
Section titled “destroy()”destroy():
void
Defined in: store/adapters/DataAdapter.ts:154
Destroys the adapter.
Returns
Section titled “Returns”void
Overrides
Section titled “Overrides”Call Signature
Section titled “Call Signature”get():
DataSchema
Defined in: store/adapters/DataAdapter.ts:226
Loads data from storage. If a key is provided, returns the value for that key. If no key is provided, returns all data.
Returns
Section titled “Returns”The loaded data
Implementation of
Section titled “Implementation of”Call Signature
Section titled “Call Signature”get<
K
>(key?
):undefined
|DataSchema
[K
]
Defined in: store/adapters/DataAdapter.ts:227
Loads data from storage. If a key is provided, returns the value for that key. If no key is provided, returns all data.
Type Parameters
Section titled “Type Parameters”K
extends string
| number
The type of the key to load
Parameters
Section titled “Parameters”K
Optional key to load specific data
Returns
Section titled “Returns”undefined
| DataSchema
[K
]
The loaded data
Implementation of
Section titled “Implementation of”getCoreSignals()
Section titled “getCoreSignals()”getCoreSignals():
string
[]
Defined in: store/adapters/DataAdapter.ts:147
Returns
Section titled “Returns”string
[]
Overrides
Section titled “Overrides”StorageAdapter.getCoreSignals
increment()
Section titled “increment()”increment<
K
>(key
,amount
):any
Defined in: store/adapters/DataAdapter.ts:242
Increments a numeric property by a specified amount.
Type Parameters
Section titled “Type Parameters”K
extends string
The type of keys in D where the value is a number
Parameters
Section titled “Parameters”K
The key of the property to increment
amount
Section titled “amount”number
= 1
The amount to increment by (default: 1)
Returns
Section titled “Returns”any
The new value after incrementing
Implementation of
Section titled “Implementation of”initialize()
Section titled “initialize()”initialize(
options?
):void
Defined in: store/adapters/DataAdapter.ts:163
Initializes the adapter.
Parameters
Section titled “Parameters”options?
Section titled “options?”Partial
<DataSchema
>
The options to initialize the adapter with.
Returns
Section titled “Returns”void
Overrides
Section titled “Overrides”load()
Section titled “load()”load<
TExpectedLoadResult
>(_key
):undefined
|TExpectedLoadResult
|Promise
<TExpectedLoadResult
>
Defined in: store/adapters/StorageAdapter.ts:58
Loads data from a specified key.
Type Parameters
Section titled “Type Parameters”TExpectedLoadResult
Section titled “TExpectedLoadResult”TExpectedLoadResult
= any
Parameters
Section titled “Parameters”string
The key from which to load the data.
Returns
Section titled “Returns”undefined
| TExpectedLoadResult
| Promise
<TExpectedLoadResult
>
A promise that resolves with the loaded data, or the loaded data if the load operation is synchronous, or null if no data was found.
Inherited from
Section titled “Inherited from”postInitialize()
Section titled “postInitialize()”postInitialize(
_app
):void
|Promise
<void
>
Defined in: plugins/Plugin.ts:67
Parameters
Section titled “Parameters”Returns
Section titled “Returns”void
| Promise
<void
>
Inherited from
Section titled “Inherited from”save()
Section titled “save()”save<
TExpectedSaveResult
>(_key
,_data
, …_rest
):any
Defined in: store/adapters/StorageAdapter.ts:72
Saves data under a specified key.
Type Parameters
Section titled “Type Parameters”TExpectedSaveResult
Section titled “TExpectedSaveResult”TExpectedSaveResult
= any
Parameters
Section titled “Parameters”string
any
…any
[]
Returns
Section titled “Returns”any
A promise that resolves when the data has been saved, or void if the save operation is synchronous.
Inherited from
Section titled “Inherited from”Call Signature
Section titled “Call Signature”set<
K
>(key
,data
):DataSchema
Defined in: store/adapters/DataAdapter.ts:178
Sets data for a specific key in storage.
Type Parameters
Section titled “Type Parameters”K
extends string
| number
Parameters
Section titled “Parameters”K
The key under which to save the data
DataSchema
[K
]
The data to save
Returns
Section titled “Returns”The updated data object
Implementation of
Section titled “Implementation of”Call Signature
Section titled “Call Signature”set(
data
,merge?
):DataSchema
Defined in: store/adapters/DataAdapter.ts:179
Merges data into storage.
Parameters
Section titled “Parameters”DeepPartial
<DataAdapterType
>
The data object to set
merge?
Section titled “merge?”boolean
Whether to merge with existing data
Returns
Section titled “Returns”The updated data object
Implementation of
Section titled “Implementation of”snapshot()
Section titled “snapshot()”Call Signature
Section titled “Call Signature”snapshot():
DataSchema
Defined in: store/adapters/DataAdapter.ts:310
Returns a snapshot of the current data.
Returns
Section titled “Returns”A snapshot of the current data
Implementation of
Section titled “Implementation of”Call Signature
Section titled “Call Signature”snapshot<
K
>(key?
):DataSchema
[K
]
Defined in: store/adapters/DataAdapter.ts:311
Returns a snapshot of the current data for a specific key.
Type Parameters
Section titled “Type Parameters”K
extends string
| number
Parameters
Section titled “Parameters”K
The key of the data to snapshot
Returns
Section titled “Returns”DataSchema
[K
]
A snapshot of the current data for the specified key