lib/mux.js
function _$add(prop, value, lazyEmit) {
        if (prop.match(/[\.\[\]]/)) {
            throw new Error('Propname shoudn\'t contains "." or "[" or "]"')
        }

        if ($indexOf(_observableKeys, prop)) {
            // If value is specified, reset value
            return arguments.length > 1 ? true : false
        }
        _props[prop] = _walk(prop, $util.copyValue(value))
        _observableKeys.push(prop)
        $util.def(model, prop, {
            enumerable: true,
            get: function() {
                return _props[prop]
            },
            set: function (v) {
                _$set(prop, v)
            }
        })
        // add peroperty will trigger change event
        if (!lazyEmit) {
            _emitChange(prop, value)
        } else {
            return {
                kp: prop,
                vl: value
            }
        }
    }
function _$add(prop, value, lazyEmit) {
        if (prop.match(/[\.\[\]]/)) {
            throw new Error('Propname shoudn\'t contains "." or "[" or "]"')
        }

        if ($indexOf(_observableKeys, prop)) {
            // If value is specified, reset value
            return arguments.length > 1 ? true : false
        }
        _props[prop] = _walk(prop, $util.copyValue(value))
        _observableKeys.push(prop)
        $util.def(model, prop, {
            enumerable: true,
            get: function() {
                return _props[prop]
            },
            set: function (v) {
                _$set(prop, v)
            }
        })
        // add peroperty will trigger change event
        if (!lazyEmit) {
            _emitChange(prop, value)
        } else {
            return {
                kp: prop,
                vl: value
            }
        }
    }
function _$add ( prop , value , lazyEmit ) { if ( prop . match ( / [\.\[\]] / ) ) { throw new Error ( 'Propname shoudn\'t contains "." or "[" or "]"' ) } if ( $indexOf ( _observableKeys , prop ) ) { // If value is specified, reset value return arguments . length > 1 ? true : false } _props [ prop ] = _walk ( prop , $util . copyValue ( value ) ) _observableKeys . push ( prop ) $util . def ( model , prop , { enumerable : true , get : function ( ) { return _props [ prop ] } , set : function ( v ) { _$set ( prop , v ) } } ) // add peroperty will trigger change event if ( ! lazyEmit ) { _emitChange ( prop , value ) } else { return { kp : prop , vl : value } } }
create a prop observer if not in observer,
return true if no value setting.
@param prop <String> property name
@param value property value
create a prop observer if not in observer return true if no value setting .