Class: Storage

Storage

new tart.storage.Storage()

Basic local storage class that adds object storage abilities to the standard html5 localStorage by serializing objects.

Methods

Clear all values from storage.

Fetches an item from the storage.

Name Type Description
key string

Key of the value to be fetched from the storage.

Returns:
Type Description
* Value of the item.

getCount(){number}

Get the number of stored key-value pairs.

Returns:
Type Description
number Number of stored elements

Remove value from storage.

Name Type Description
key string

Key of the associated pair.

set(key, value)

Sets a key value pair to the local storage.

Name Type Description
key string

Key of the pair to be stored.

value *

Value of the pair to be stored. The value will be stored serialized.