lib/mux.js
function _walk (name, value, mountedPath) {
        var tov = $type(value) // type of value
        // initial path prefix is root path
        var kp = mountedPath ? mountedPath : $join(_rootPath(), name)
        /**
         *  Array methods hook
         */
        if (tov == ARRAY) {
            $arrayHook(value, function (self, methodName, nativeMethod, args) {
                var pv = $util.copyArray(self)
                var result = nativeMethod.apply(self, args)
                // set value directly after walk
                _props[name] = _walk(name, self, kp)
                if (methodName == 'splice') {
                    _emitChange(kp, self, pv, methodName, args)
                } else {
                    _emitChange(kp, self, pv, methodName)
                }
                return result
            })
        }

        // deep observe into each property value
        switch(tov) {
            case OBJECT: 
                // walk deep into object items
                var props = {}
                var obj = value
                if (instanceOf(value, Mux)) obj = value.$props()
                $util.objEach(obj, function (k, v) {
                    props[k] = _walk(k, v, $join(kp, k))
                })
                return _subInstance(value, props, kp)
            case ARRAY:
                // walk deep into array items
                value.forEach(function (item, index) {
                    value[index] = _walk(index, item, $join(kp, index))
                })
                return value
            default: 
                return value
        }
    }
function _walk (name, value, mountedPath) {
        var tov = $type(value) // type of value
        // initial path prefix is root path
        var kp = mountedPath ? mountedPath : $join(_rootPath(), name)
        /**
         *  Array methods hook
         */
        if (tov == ARRAY) {
            $arrayHook(value, function (self, methodName, nativeMethod, args) {
                var pv = $util.copyArray(self)
                var result = nativeMethod.apply(self, args)
                // set value directly after walk
                _props[name] = _walk(name, self, kp)
                if (methodName == 'splice') {
                    _emitChange(kp, self, pv, methodName, args)
                } else {
                    _emitChange(kp, self, pv, methodName)
                }
                return result
            })
        }

        // deep observe into each property value
        switch(tov) {
            case OBJECT: 
                // walk deep into object items
                var props = {}
                var obj = value
                if (instanceOf(value, Mux)) obj = value.$props()
                $util.objEach(obj, function (k, v) {
                    props[k] = _walk(k, v, $join(kp, k))
                })
                return _subInstance(value, props, kp)
            case ARRAY:
                // walk deep into array items
                value.forEach(function (item, index) {
                    value[index] = _walk(index, item, $join(kp, index))
                })
                return value
            default: 
                return value
        }
    }
function _walk ( name , value , mountedPath ) { var tov = $type ( value ) // type of value // initial path prefix is root path var kp = mountedPath ? mountedPath : $join ( _rootPath ( ) , name ) /**
         *  Array methods hook
         */ if ( tov == ARRAY ) { $arrayHook ( value , function ( self , methodName , nativeMethod , args ) { var pv = $util . copyArray ( self ) var result = nativeMethod . apply ( self , args ) // set value directly after walk _props [ name ] = _walk ( name , self , kp ) if ( methodName == 'splice' ) { _emitChange ( kp , self , pv , methodName , args ) } else { _emitChange ( kp , self , pv , methodName ) } return result } ) } // deep observe into each property value switch ( tov ) { case OBJECT : // walk deep into object items var props = { } var obj = value if ( instanceOf ( value , Mux ) ) obj = value . $props ( ) $util . objEach ( obj , function ( k , v ) { props [ k ] = _walk ( k , v , $join ( kp , k ) ) } ) return _subInstance ( value , props , kp ) case ARRAY : // walk deep into array items value . forEach ( function ( item , index ) { value [ index ] = _walk ( index , item , $join ( kp , index ) ) } ) return value default : return value } }
A hook method for setting value to "_props"
@param name <String> property name
@param value
@param mountedPath <String> property's value mouted path
A hook method for setting value to _props