ludo.storage.LocalStorage

ludo.storage.


new ludo.storage.LocalStorage()

Class for saving data to local storage(browser cache).

ludo.getLocalStorage() returns a singleton for ludo.storage.LocalStorage

Source:
Example
ludo.getLocalStorage().save('name', 'John');
ludo.getLocalStorage().save('myobject', { "a": 1, "b" : 2 ));
ludo.getLocalStorage().get('myobject');

Methods


get(key, defaultValue) → {*}

Get value from local storage

Parameters:
Name Type Description
key string
defaultValue mixed
Source:
Returns:
Type
*

save(key, value)

Parameters:
Name Type Description
key String
value String | Number | Array | Object
Source: