hsp/propobserver.js
function (observer, property) {
        if (!property)
            property = ALL;
        var arr = this.props[property];
        if (!arr) {
            // property is not observed yet
            arr = [];
            this.props[property] = arr;
        }
        arr.push(observer);
    }
function (observer, property) {
        if (!property)
            property = ALL;
        var arr = this.props[property];
        if (!arr) {
            // property is not observed yet
            arr = [];
            this.props[property] = arr;
        }
        arr.push(observer);
    }
function ( observer , property ) { if ( ! property ) property = ALL ; var arr = this . props [ property ] ; if ( ! arr ) { // property is not observed yet arr = [ ] ; this . props [ property ] = arr ; } arr . push ( observer ) ; }
Add a new observer for a given property
@param {object} observer object with a onPropChange() method
@param {string} property the property name to observe (optional)
Add a new observer for a given property