Handler

Handler

The proxy handler.

This class will inform any value change directly to the state manager.

The proxied variable will throw an error if it is altered when the state manager is in read only mode.

Constructor

new Handler(name, stateManager, proxyValues)

Source:

Class constructor.

Parameters:
Name Type Description
name string

the variable name used for identify triggered actions

stateManager StateManager

the state manager object

proxyValues boolean

if new values must be proxied (used only at state root level)

Methods

deleteProperty(obj, prop) → {boolean}

Source:

Delete property trap to trigger state change events.

Parameters:
Name Type Description
obj *

the affected object (not proxied)

prop *

the prop to delete

Returns:

if prop is deleted

Type
boolean

set(obj, prop, value, receiver) → {boolean}

Source:

Set trap to trigger events when the state changes.

Parameters:
Name Type Description
obj object

the source object (not proxied)

prop string

the attribute to set

value *

the value to save

receiver *

the proxied element to be attached to events

Returns:

if the value is set

Type
boolean