Mixin adds methods for setting deep properties and add observers
Methods
-
destroy()
-
Destroy observers
-
getProperty(property)
-
Get deep property using path
Parameters:
Name Type Description propertystring property path Returns:
property value- Type
- *
Example
prop1.prop2.prop3
-
hasProperty(property)
-
Check if property exists
Parameters:
Name Type Description propertystring property path Returns:
has / has not- Type
- boolean
Example
prop1.prop2.prop3
-
observeProperty(property, callback, scope, create, value)
-
Observe property for changes. Only one observer is alowed for each property
Parameters:
Name Type Description propertystring property path callbackfunction change callback scopeobject | undefined callback scope createboolean create property if it doesn't exists value* start value for created property Returns:
returns self for chaining- Type
- object
Example
prop1.prop2.prop3
-
removeObserver(property)
-
Remove observer
Parameters:
Name Type Description propertystring property path Returns:
returns self for chaining- Type
- object
-
setProperty(property, value)
-
Set deep property using path
Parameters:
Name Type Description propertystring property path value* property value Returns:
returns self for chaining- Type
- object
Example
prop1.prop2.prop3