Storage ‹ Chocolat API

.get(k)

Retrieves a value in the storage.

  • k String – the key to retrieve.

Returns Object – the value for the given key.

.set(k, v)

Sets a value in the storage.

  • k String – the key to set.
  • v Object – the value to set it to (can be anything).

.count()

Returns the number of keys in the storage.
s

Returns Number – number of keys in storage.

.forall(f)

Applies function f to every items in the storage. The function should
have the following signature: f(k, v) where k is the key for the item
and v is its value.

  • f Function – the function to apply to each items `f(k,v)`.