WebStorage <T>
Hierarchy
- WebStorage
Index
Constructors
constructor
Type parameters
- T
Parameters
key: string
initialValue: T
storage: Storage
optionaloptions: StorageOptions<T>
Returns WebStorage<T>
Accessors
initialValue
Returns T
value
Read value from storage or return initial value if value does not exist in storage
Returns T
Methods
has
Check if the value exists in storage
Returns boolean
true if the value exists in storage
reset
Reset storage to initial value
Returns void
write
Write value to storage and return the value written
Parameters
value: T
Value to write to storage
Returns T
Get initial value of storage