Class

KVOObject

KVOObject

Key-Value Observing object.

Methods

# get(key) → {*}

Parameters:
Name Type Description
key string
*

# getValues() → {Object}

Returns all values as key value pairs.
Object

# set(key, value, overwriteopt)

Sets the value for the given key. If the new value is different from the old value, or if the overwrite parameter is true, the value is set and the appropriate events are emitted.
Parameters:
Name Type Attributes Default Description
key string The key to set.
value * The new value.
overwrite boolean <optional>
false If true, the value is set even if it's the same as the old value.

# setValues(values)

Parameters:
Name Type Description
values Object

Events

# changed

This event will fire when any value is changed.
Properties:
Name Type Description
args Object
key string The key of the value that has changed.
newValue * The new value.
oldValue * The old value.
Example
instance.addListener('changed', (args) => {...});