Library.Storage

Do not use this directly, this Library needs to be implemented on a class.

Example

var myClassPrototype = new MAF.Class({
    Implements: [
       Library.Storage
    ]
 });

 var myClass = new myClassPrototype();
 myClass.store('some_number', 123);
 myClass.retrieve('some_number'); // Returns 123
 myClass.eliminate('some_number');

Methods

eliminate(key)

Removes a key from the storage.

Parameters:

NameTypeDescription
keyString

Deletes the value if key exists.

retrieve(key)

Retrieves a value from the storage.

Parameters:

NameTypeDescription
keyString

Retrieves the value if key exists.

store(key, value)

Saves a value to be availeble on the instance this Library is placed.

Parameters:

NameTypeDescription
keyString

Key needs to be string.

valueMixed

Supports the storing of Strings, Numbers, Objects, Arrays. basically any JSONeable value.