LocalStorage Class
Implementation of the storage abstraction utilizing a window.localStorage
If the localStorage is not available an error is thrown during construction
Usability of this storage can be checked using the static isCompatible method.
In addition of providing compatibility checking stored data will automatically be converted between object and string representation to allow the storage of arbitrary datastructures
Constructor
LocalStorage
()
Methods
getItem
(
-
key
Retrieve an item from the storage
Parameters:
-
key
String
Returns:
:
isComaptible
()
Boolean
static
Check whether this storage implementation is compatible with the current environment.
Returns:
Boolean:
removeItem
(
-
key
Remove an item from storage
Parameters:
-
key
String
setItem
(
-
key
-
value
Store an item in storage
Parameters:
-
key
String -
value
Properties
_storage
Storage
private
Session storage which is internally used to store and retrieve data