Storage is an interface which describe common operations supported by storage implementations.
Methods
add Change Listener(key, change Listener)
Register change listener for given key of stored data.
Parameters:
Name | Type | Description |
---|---|---|
key |
String | Identifier of stored data. |
changeListener |
Object | Function to be invoked when change of value occurs. |
delete(key)
Delete value from storage.
Parameters:
Name | Type | Description |
---|---|---|
key |
String | Identifier of stored data to be deleted. |
remove Change Listener(key, change Listener)
Unregister change listener for given key of stored data.
Parameters:
Name | Type | Description |
---|---|---|
key |
String | Identifier of stored data. |
changeListener |
Object | Function to be unregistered from listening to change of value. |
save(key, data)
Save value to storage.
Parameters:
Name | Type | Description |
---|---|---|
key |
String | Identifier of data to be stored. |
data |
String | Data to store. |