Class: SessionMapStorage<V>
Defined in: packages/core/src/storage/SessionMapStorage.ts:12
The link SessionMap
storage is an implementation of the
link Storage
interface acting as a synchronization proxy between
the underlying map storage and the sessionStorage
DOM storage.
Extends
Storage
<V
>
Type Parameters
• V
Constructors
new SessionMapStorage()
new SessionMapStorage<
V
>(map
,session
):SessionMapStorage
<V
>
Defined in: packages/core/src/storage/SessionMapStorage.ts:32
Initializes the storage.
Parameters
map
MapStorage
<V
>
The map storage to use.
session
The session storage to use.
Returns
Overrides
Accessors
$dependencies
Get Signature
get
static
$dependencies():Dependencies
Defined in: packages/core/src/storage/SessionMapStorage.ts:22
Returns
Methods
clear()
clear():
this
Defined in: packages/core/src/storage/SessionMapStorage.ts:106
Clears the storage of all entries.
Returns
this
This storage.
Overrides
delete()
delete(
key
):this
Defined in: packages/core/src/storage/SessionMapStorage.ts:96
Deletes the entry identified by the specified key from this storage.
Parameters
key
string
The key identifying the storage entry.
Returns
this
This storage.
Overrides
get()
get(
key
):undefined
|V
Defined in: packages/core/src/storage/SessionMapStorage.ts:71
Retrieves the value of the entry identified by the specified . The
method returns undefined
if the entry does not exists.
Entries set to the undefined
value can be tested for existence
using the link has
method.
Parameters
key
string
The key identifying the storage entry.
Returns
undefined
| V
The value of the storage entry.
Overrides
has()
has(
key
):boolean
Defined in: packages/core/src/storage/SessionMapStorage.ts:64
Returns true
if the entry identified by the specified key exists
in this storage.
Parameters
key
string
The key identifying the storage entry.
Returns
boolean
true
if the storage entry exists.
Overrides
init()
init():
this
Defined in: packages/core/src/storage/SessionMapStorage.ts:43
This method is used to finalize the initialization of the storage after the dependencies provided through the constructor have been prepared for use.
This method must be invoked only once and it must be the first method invoked on this instance.
Returns
this
This storage.
Overrides
keys()
keys():
Iterable
<string
>
Defined in: packages/core/src/storage/SessionMapStorage.ts:116
Returns an iterator for traversing the keys in this storage. The order in which the keys are traversed is undefined.
Returns
Iterable
<string
>
An iterator for traversing the keys in this
storage. The iterator also implements the iterable protocol,
returning itself as its own iterator, allowing it to be used in
a for..of
loop.
Overrides
set()
set(
key
,value
):this
Defined in: packages/core/src/storage/SessionMapStorage.ts:78
Sets the storage entry identified by the specified key to the provided value. The method creates the entry if it does not exist already.
Parameters
key
string
The key identifying the storage entry.
value
V
The storage entry value.
Returns
this
This storage.
Overrides
size()
size():
number
Defined in: packages/core/src/storage/SessionMapStorage.ts:123
Returns the number of entries in this storage.
Returns
number
The number of entries in this storage.