Class TJSSessionStorage
Hierarchy
- TJSWebStorage
- TJSSessionStorage (view full)
Index
Constructors
Methods
Constructors
constructor
- new TJSSession
Storage (): TJSSessionStorage Returns TJSSessionStorage
Methods
entries
- entries<T>(regex?): IterableIterator<[string, Writable<T>], any, any>
Type Parameters
Parameters
Optional
regex: RegExpOptional regular expression to filter by storage keys.
Returns IterableIterator<[string, Writable<T>], any, any>
Iterable iterator of keys and stores.
getItem
getStore
- get
Store <T>(key, defaultValue?, storageStores?): Writable<T> Returns the backing Svelte store for the given key; potentially sets a default value if the key is not already set.
Type Parameters
Parameters
- key: string
Key to lookup in storage API.
Optional
defaultValue: TA default value to return if key not present in session storage.
Optional
storageStores: StorageStoresAdditional store creation options.
Returns Writable<T>
The Svelte store for this key.
- key: string
hasStore
keys
- keys(regex?): IterableIterator<string, any, any>
Returns an iterable for the session storage keys from existing stores.
Parameters
Optional
regex: RegExpOptional regular expression to filter by storage keys.
Returns IterableIterator<string, any, any>
Iterable iterator of session storage keys.
setItem
stores
- stores<T>(regex?): IterableIterator<Writable<T>, any, any>
Type Parameters
Parameters
Optional
regex: RegExpOptional regular expression to filter by storage keys.
Returns IterableIterator<Writable<T>, any, any>
Iterable iterator of stores.
swapItemBoolean
- swap
Item (key, defaultValue?): booleanBoolean Convenience method to swap a boolean value stored in storage API updating the associated store value.
Parameters
- key: string
Key to lookup in storage API.
Optional
defaultValue: booleanA default value to return if key not present in session storage.
Returns boolean
The boolean swap for the given key.
- key: string
Provides a TJSWebStorage instance for standard browser session storage use cases.