onKeyValue
Add handler to event queue.
globals.onKeyValue(key, handler)
Calls handler
each time the value of key
is set or reset.
globals.define('foo', 'bar');
globals.onKeyValue('foo', (value) => {
value === 'baz' //-> true
});
globals.setKeyValue('foo', 'baz');
Parameters
- key
{String}
:The key value to observe.
- handler
{function(value)}
:The observer callback.