dist/doz.js
/**
         * Create
         * @description Public method that is invoked to create a new ES6 Proxy whose changes we can observe through the Observerable.observe() method.
         * @param target {Object} required, plain JavaScript object that we want to observe for changes.
         * @param domDelay {Boolean} if true, then batch up changes on a 10ms delay so a series of changes can be processed in one DOM update.
         * @param observer {Function} optional, will be invoked when a change is made to the proxy.
         * @returns {Object}
         */
Create
@description Public method that is invoked to create a new ES6 Proxy whose changes we can observe through the Observerable.observe() method.
@param target {Object} required, plain JavaScript object that we want to observe for changes.
@param domDelay {Boolean} if true, then batch up changes on a 10ms delay so a series of changes can be processed in one DOM update.
@param observer {Function} optional, will be invoked when a change is made to the proxy.
@returns {Object}
Create @description Public method that is invoked to create a new ES6 Proxy whose changes we can observe through the Observerable . observe () method . @param target { Object } required plain JavaScript object that we want to observe for changes . @param domDelay { Boolean } if true then batch up changes on a 10ms delay so a series of changes can be processed in one DOM update . @param observer { Function } optional will be invoked when a change is made to the proxy . @returns { Object }
function create(target, domDelay, observer) {
            if (target.__isProxy === true) {
                target = target.__getTarget;
            }
            var proxy = _create(target, domDelay);
            if (typeof observer === 'function') this.observe(proxy, observer);
            (function iterate(proxy) {
                var target = proxy.__getTarget;
                var keys = Object.keys(target);
                for (var i = 0, l = keys.length; i < l; i++) {
                    var property = keys[i];
                    if (target[property] instanceof Object && target[property] !== null) iterate(proxy[property]);
                }
            })(proxy);
            return proxy;
        }
function create ( target , domDelay , observer ) { if ( target . __isProxy === true ) { target = target . __getTarget ; } var proxy = _create ( target , domDelay ) ; if ( typeof observer === 'function' ) this . observe ( proxy , observer ) ; ( function iterate ( proxy ) { var target = proxy . __getTarget ; var keys = Object . keys ( target ) ; for ( var i = 0 , l = keys . length ; i < l ; i ++ ) { var property = keys [ i ] ; if ( target [ property ] instanceof Object && target [ property ] !== null ) iterate ( proxy [ property ] ) ; } } ) ( proxy ) ; return proxy ; }
Create
 @description Public method that is invoked to create a new ES6 Proxy whose changes we can observe through the Observerable.observe() method.
Create @description Public method that is invoked to create a new ES6 Proxy whose changes we can observe through the Observerable . observe () method .
// test if the target is a Proxy, if it is then we need to retrieve the original object behind the Proxy. // we do not allow creating proxies of proxies because -- given the recursive design of ObservableSlim -- it would lead to sharp increases in memory usage //if it is, then we should throw an error. we do not allow creating proxies of proxies // because -- given the recursive design of ObservableSlim -- it would lead to sharp increases in memory usage //throw new Error('ObservableSlim.create() cannot create a Proxy for a target object that is also a Proxy.'); // fire off the _create() method -- it will create a new observable and proxy and return the proxy // assign the observer function // recursively loop over all nested objects on the proxy we've just created // this will allow the top observable to observe any changes that occur on a nested object