benchmarks/scenarios/ember.js
function (modelName, typesUpdated) {
      var _this3 = this;

      var klass = this._nameToClass(modelName);
      var records = this.getRecords(klass, modelName);

      var onChange = function () {
        typesUpdated([_this3.wrapModelType(klass, modelName)]);
      };
      var observer = {
        didChange: function () {
          _emberMetalRun_loop.default.scheduleOnce('actions', this, onChange);
        },
        willChange: function () {
          return this;
        }
      };

      _emberRuntimeMixinsArray.addArrayObserver(records, this, observer);

      var release = function () {
        _emberRuntimeMixinsArray.removeArrayObserver(records, _this3, observer);
      };

      return release;
    }
function (modelName, typesUpdated) {
      var _this3 = this;

      var klass = this._nameToClass(modelName);
      var records = this.getRecords(klass, modelName);

      var onChange = function () {
        typesUpdated([_this3.wrapModelType(klass, modelName)]);
      };
      var observer = {
        didChange: function () {
          _emberMetalRun_loop.default.scheduleOnce('actions', this, onChange);
        },
        willChange: function () {
          return this;
        }
      };

      _emberRuntimeMixinsArray.addArrayObserver(records, this, observer);

      var release = function () {
        _emberRuntimeMixinsArray.removeArrayObserver(records, _this3, observer);
      };

      return release;
    }
function ( modelName , typesUpdated ) { var _this3 = this ; var klass = this . _nameToClass ( modelName ) ; var records = this . getRecords ( klass , modelName ) ; var onChange = function ( ) { typesUpdated ( [ _this3 . wrapModelType ( klass , modelName ) ] ) ; } ; var observer = { didChange : function ( ) { _emberMetalRun_loop . default . scheduleOnce ( 'actions' , this , onChange ) ; } , willChange : function ( ) { return this ; } } ; _emberRuntimeMixinsArray . addArrayObserver ( records , this , observer ) ; var release = function ( ) { _emberRuntimeMixinsArray . removeArrayObserver ( records , _this3 , observer ) ; } ; return release ; }
Adds observers to a model type class.
@private
@method observeModelType
@param {String} modelName The model type name.
@param {Function} typesUpdated Called when a type is modified.
@return {Function} The function to call to remove observers.
Adds observers to a model type class .