DiskStorage Class
Item Index
Attributes
Methods
clone
-
[name]
-
[engine]
Return a new DiskStorage object with the same keys and values
Parameters:
-
[name]
String optionalnew namespace; defaults to "default"
-
[engine]
String optional"localStorage" or "sessionStorage"; defaults to the current instance's engine
Returns:
destroy
()
DiskStorage
chainable
Clear the data and remove the DiskStorage data from localStorage/sessionStorage Note that the object will flush to disk if any new values are added
Returns:
flush
()
DiskStorage
chainable
Flush to disk (localStorage or sessionStorage). Is triggered automatically on the next event loop when data changes
Returns:
forEach
-
callback
-
[thisArg]
Iterate through the collection
Parameters:
-
callback
FunctionThe iterator function. Will receive three parameters: value, key, this DiskStorage instance
-
[thisArg]
Object optionalThe scope in which to execute the callback; defaults to this DiskStorage instance
Returns:
get
-
key
Get a previously stored value
Parameters:
-
key
StringThe name of the value
Returns:
isSupported
()
Boolean
static
Return true if localStorage, sessionStorage and JSON are available
Returns:
True if browser will support DiskStorage
load
-
data
Replace the internal data with the one given
Parameters:
-
data
Objectdata to load
Returns:
remove
-
key
Unset a stored value
Parameters:
-
key
StringThe name to unset
Returns:
set
-
key
-
value
Store data for later retreival
Parameters:
-
key
StringThe name of the value
-
value
AnyThe data to store
Returns:
Properties
data
Object
The data
engine
String
"localStorage" or "sessionStorage"
isDirty
Boolean
True if flush should write to disk
name
String
The namespace of the store