Options
All
  • Public
  • Public/Protected
  • All
Menu

Represents an isolated context for key/value pairs and entities. Here, a "context" is essentially type-enforced namespace for keys.

So a context with a prefix of "myFeatureStorage" would have keys like

  • "myFeatureStorage$itemCount"
  • "myFeatureStorage$someSubContext$item42"
  • "myFeatureStorage$someSubContext$entityMap$length"

Hierarchy

  • StorageContext

Implements

Index

Constructors

constructor

Properties

Readonly options

options: StorageContextOptions = ...

Protected Readonly parent

parent: null | StorageContext = null

Readonly transport

Static absolutePrefixSeparator

absolutePrefixSeparator: string = '$'

Accessors

absoluteKeyPrefix

  • get absoluteKeyPrefix(): string

Methods

clear

  • clear(): Promise<void>

createEntity

createEntityArray

createEntityMap

getAbsoluteKey

  • getAbsoluteKey(relativeKey: string): string

getItem

  • getItem(key: string): Promise<undefined | null | string>

getKeyValuePair

getSubContext

keys

  • keys(): Promise<string[]>

removeItem

  • removeItem(key: string): Promise<void>

setItem

  • setItem(key: string, value: string): Promise<void>

Generated using TypeDoc