SharedProviderStorage

Simple async key/value storage abstraction operating on top of a single key within the given StorageProvider instance. As the name suggests, the given StorageProvider instance can be shared between multiple SharedProviderStorage instances

Supports nested object paths in get/set/remove using . like normal object accessors

Note: The storage provider given to the constructor should already be initialized via its init() method

Methods

.clear() → Promise<void>

Remove all key/value pairs from storage for this instance

Source:
Returns:
Promise<void>

.exists(key: string) → Promise<boolean>

Check if a value exists in storage for this instance

Parameters:
Name Type Description
key
string

The key in storage to check

Source:
Returns:
Promise<boolean>

.get(key: string) → Promise<any>

Get a value from storage for this instance

Parameters:
Name Type Description
key
string

The key in storage to get

Source:
Returns:
Promise<any>

.init() → Promise<void>

Initialize this storage instance

Source:
Returns:
Promise<void>

.keys() → Promise<string[]>

Get the names of all keys in this storage for this instance

Source:
Returns:
Promise<string[]>

.remove(key: string) → Promise<void>

Remove a value from storage for this instance

Parameters:
Name Type Description
key
string

The key in storage to remove

Source:
Returns:
Promise<void>

.set(key: string, value: any) → Promise<void>

Set a value in storage for this instance

Parameters:
Name Type Description
key
string

The key in storage to set

value
any

The value to set

Source:
Returns:
Promise<void>