A memento represents a storage utility. It can store and retrieve values.

Fields

update(key:String, value:Any):Thenable<Void>

Store a value. The value must be JSON-stringifyable.

Parameters:

key

A string.

value

A value. MUST not contain cyclic references.

keys():ReadOnlyArray<String>

Returns the stored keys.

Returns:

The stored keys.

get<T>(key:String):Null<T>

get<T>(key:String, defaultValue:T):T

Return a value.

Parameters:

key

A string.

defaultValue

A value that should be returned when there is no value (undefined) with the given key.

Returns:

The stored value, undefined, or the defaultValue.