examples/unidirectional/backbone/observ-backbone.js
function listen(model, listener) {
    model.on('change', listener);

    model.values().forEach(function listenRecur(value) {
        var isCollection = value && value._byId;

        if (!isCollection) {
            return;
        }

        // for each collection listen to it
        // console.log('listenCollection')
        listenCollection(value, listener);
    });
}
function listen(model, listener) {
    model.on('change', listener);

    model.values().forEach(function listenRecur(value) {
        var isCollection = value && value._byId;

        if (!isCollection) {
            return;
        }

        // for each collection listen to it
        // console.log('listenCollection')
        listenCollection(value, listener);
    });
}
function listen ( model , listener ) { model . on ( 'change' , listener ) ; model . values ( ) . forEach ( function listenRecur ( value ) { var isCollection = value && value . _byId ; if ( ! isCollection ) { return ; } // for each collection listen to it // console.log('listenCollection') listenCollection ( value , listener ) ; } ) ; }
listen to a Backbone model
listen to a Backbone model