Added uuid function to element class to easily allow generating uuid's. May move this later. Added reflect() option to reflect properties once changed via a function or another property. Added onResize function that adds a resize observer to the element constructed by a template and cleans it up nicely. Added onTouch event helper function. Modified reflect callback to allow calling functions or setting the value of a property.

This commit is contained in:
2021-01-09 16:24:24 -08:00
parent e58e6e58e4
commit e398b61c08
3 changed files with 88 additions and 3 deletions

View File

@ -63,7 +63,7 @@ class IgniteProperty {
//If we want to reflect the value then bubble it up.
if (reflect) {
this.ignoreValueChange = true; //Ignore changes incase we are connected to any reflected properties.
this.reflected.forEach(reflect => reflect.value = val);
this.reflected.forEach(reflect => reflect instanceof Function ? reflect(val) : (reflect.value = val));
this.ignoreValueChange = false;
}