Store v 2.0
A helper to store data into the LocalStorage. The data is available for later usage.
Since 2.0 a wrapper for the jStorage plugin
Methods
| method name | default | arguments | description | since | info |
|---|---|---|---|---|---|
| save | key, value | save the value 'value' with the key 'key'. value can be a integer, array, string, object | 1.0 | ||
| get | key | gets the key from the storage | 1.0 | ||
| remove | key | delete the key from the storage | 1.0 | ||
| flush | delete the whole storage | 1.0 | |||
| index | returns a list of used keys in the storage. Format {namespace}_{key} | 2.0 |
Usage
var wl_Store = new $.wl_Store([namespace]);
var toStore = {
foo:true,
bar:'foo',
fooBar:'abc'
}
wl_Store.save('myStore', toStore);
Restore
var wl_Store = new $.wl_Store([namespace]);
toStore = wl_Store.get('myStore');