src/debug/registry.js
function registerModel(model) {
  var name = model.getDebugName();
  var wrapped = flatRegistry.models[name] = new RegistryWrapper(model, 'models');
  if (typeof model.destroy === 'function') {
    wrapped.destroy = _.bind(model.destroy, model);
    model.destroy = _.bind(function() {
      var name = this.obj.getDebugName();
      delete flatRegistry.models[name];
      updateNestedModels();
      triggerChange();
      this.destroy();
    }, wrapped);
  }
  triggerChange();
}
function registerModel(model) {
  var name = model.getDebugName();
  var wrapped = flatRegistry.models[name] = new RegistryWrapper(model, 'models');
  if (typeof model.destroy === 'function') {
    wrapped.destroy = _.bind(model.destroy, model);
    model.destroy = _.bind(function() {
      var name = this.obj.getDebugName();
      delete flatRegistry.models[name];
      updateNestedModels();
      triggerChange();
      this.destroy();
    }, wrapped);
  }
  triggerChange();
}
function registerModel ( model ) { var name = model . getDebugName ( ) ; var wrapped = flatRegistry . models [ name ] = new RegistryWrapper ( model , 'models' ) ; if ( typeof model . destroy === 'function' ) { wrapped . destroy = _ . bind ( model . destroy , model ) ; model . destroy = _ . bind ( function ( ) { var name = this . obj . getDebugName ( ) ; delete flatRegistry . models [ name ] ; updateNestedModels ( ) ; triggerChange ( ) ; this . destroy ( ) ; } , wrapped ) ; } triggerChange ( ) ; }
Adds a Model to the registry

@param  {Object} model Model to register
Adds a Model to the registry