src/common/property-observer/index.js
function observeInner(widget, el, attribute, path, dirtyPath, callback) {
    Object.defineProperty(el, attribute, {
        get() {
            return _get(widget.state, `${path}.${attribute}`);
        },
        set(value) {
            _set(widget.state, `${path}.${attribute}`, value);
            if (dirtyPath) {
                widget.setStateDirty(dirtyPath);
            }
            callback(el);
        }
    });
}
function observeInner(widget, el, attribute, path, dirtyPath, callback) {
    Object.defineProperty(el, attribute, {
        get() {
            return _get(widget.state, `${path}.${attribute}`);
        },
        set(value) {
            _set(widget.state, `${path}.${attribute}`, value);
            if (dirtyPath) {
                widget.setStateDirty(dirtyPath);
            }
            callback(el);
        }
    });
}
function observeInner ( widget , el , attribute , path , dirtyPath , callback ) { Object . defineProperty ( el , attribute , { get ( ) { return _get ( widget . state , ` ${ path } ${ attribute } ` ) ; } , set ( value ) { _set ( widget . state , ` ${ path } ${ attribute } ` , value ) ; if ( dirtyPath ) { widget . setStateDirty ( dirtyPath ) ; } callback ( el ) ; } } ) ; }
Define getter and setter on a non-root DOM element of the widget
@param {Object} widget: Widget instance
@param {HTMLElement} el: Element for attaching observer
@param {String} attribute: Name of stateful property
@param {String} path: Path to part of state that needs to be accessed
@param {String} dirtyPath: Path to use with setStateDirty()
Define getter and setter on a non - root DOM element of the widget