new DomStore(name)
Constructor for store objects that use DOM storage as the underlying mechanism.
Parameters:
Name | Type | Description |
---|---|---|
name |
String | Store name. |
- Source:
Members
-
mechanism
-
Identifies the underlying mechanism used by the store.
- Source:
Methods
-
<static> create(name) → {Object}
-
Creates a store object that uses DOM Storage as its underlying mechanism.
Parameters:
Name Type Description name
String Store name. - Source:
Returns:
Store object.- Type
- Object
-
add(key, value, success, error)
-
Adds a new value identified by a key to the store.
Parameters:
Name Type Argument Description key
String Key string. value
Value that is going to be added to the store. success
function Callback for a successful add operation. error
function <optional>
Callback for handling errors. If not specified then store.defaultError is invoked. This method errors out if the store already contains the specified key. - Source:
-
addOrUpdate(key, value, success, error)
Adds or updates a value identified by a key to the store.
-
This method will overwrite the key's current value if it already exists in the store; otherwise it simply adds the new key and value.
Parameters:
Name Type Argument Description key
String Key string. value
Value that is going to be added or updated to the store. success
function Callback for a successful add or update operation. error
function <optional>
Callback for handling errors. If not specified then store.defaultError is invoked. - Source:
-
clear(success, error)
Removes all the data associated with this store object.
-
In case of an error, this method will not restore any keys that might have been deleted at that point.
Parameters:
Name Type Argument Description success
function Callback for a successful clear operation. error
function <optional>
Callback for handling errors. If not specified then store.defaultError is invoked. - Source:
-
close()
-
This function does nothing in DomStore as it does not have a connection model
- Source:
-
contains(key, success, error)
-
Checks whether a key exists in the store.
Parameters:
Name Type Argument Description key
String Key string. success
function Callback indicating whether the store contains the key or not. error
function <optional>
Callback for handling errors. If not specified then store.defaultError is invoked. - Source:
-
getAllKeys(success, error)
-
Gets all the keys that exist in the store.
Parameters:
Name Type Argument Description success
function Callback for a successful get operation. error
function <optional>
Callback for handling errors. If not specified then store.defaultError is invoked. - Source:
-
read(key, success, error)
-
Reads the value associated to a key in the store.
Parameters:
Name Type Argument Description key
String Key string. success
function Callback for a successful reads operation. error
function <optional>
Callback for handling errors. If not specified then store.defaultError is invoked. - Source:
-
remove(key, success, error)
-
Removes a key and its value from the store.
Parameters:
Name Type Argument Description key
String Key string. success
function Callback for a successful remove operation. error
function <optional>
Callback for handling errors. If not specified then store.defaultError is invoked. - Source:
-
update(key, value, success, error)
-
Updates the value associated to a key in the store.
Parameters:
Name Type Argument Description key
String Key string. value
New value. success
function Callback for a successful update operation. error
function <optional>
Callback for handling errors. If not specified then store.defaultError is invoked This method errors out if the specified key is not found in the store. - Source: