title: ember-data observe record array isLoading/isUpdating/hasUpdated?
body: <p>I am trying to display an list of calendar events by week. The kicker is I am trying to reuse data already in the DS.Store. This is the code that does it and for the most part it works. </p>
  
  <p>The problem is my <code>eventsChanged</code> observer is running way too many times. When the router fetches events from the server the <code>eventsChanged</code> observer fires for each record. I understand why that happens. What I don't get is why there is not a way to check if the recordArray is done loading a batch of records. </p>
  
  <p>Does anybody have any suggestions?</p>
  
  <pre><code>App.CalendarWeekRoute = Ember.Route.extend
    model: (params) -&gt;
      Ember.Object.create
        date:  params.date
        login: params.login
  
    serialize: (model) -&gt;
      date:  model.get 'date'
      login: model.get 'login'
  
    setupController: (controller, model) -&gt;
  
      App.Event.find
        login: model.get 'login'
        week:  model.get 'date'
  
      events    = App.Event.all()
      days      = App.DaysOfWeekFor( model.get('date') ) #returns array of dates
  
      controller.setProperties
        content: days
        events:  events
  
  
  App.CalendarWeekController = Em.ArrayController.extend
    itemController: 'calendarDay'
    events: null
  
    eventsChanged: ( -&gt;
  
      #don't run if more records are scheduled to be loaded 
      #return if @get 'events.isUpdating'
  
      days     = @get 'content'
      children = @get '_subControllers'
      events   = @get 'events'
      user     = @get 'user'
  
      return unless days and children and events and user
  
      days.forEach (date) -&gt;
        controller = children.findProperty 'content', date
        content = events.filter (event) -&gt;
          (event.get('date') is date) and
          (event.get('user') is user)
        if content
          controller.set 'content', content
  
    ).observes('content', 'events.@each')
  </code></pre>
  
  <p>EDIT This is my current hack. Using the <a href="https://gist.github.com/tchak/3529810" rel="nofollow">unofficial Ember.debounce</a></p>
  
  <pre><code>  eventsChanged: ( -&gt;
  
      days     = @get 'content'
      children = @get '_subControllers'
      events   = @get 'events'
      user     = @get 'user'
  
      return unless days and children and events and user
  
      days.forEach (date) -&gt;
        controller = children.findProperty 'content', date
        content = events.filter (event) -&gt;
          (event.get('date') is date) and
          (event.get('user') is user)
        if content
          controller.set 'content', content
  
      ).observes('content',  'didUpdate')
  
      notifyEventsChanged: Ember.debounce(
        @
        (_this) -&gt;
          _this.notifyPropertyChange('didUpdate')
        200
        false
     ).observes('events.@each')
  </code></pre>