ember-data: How to make a Saving/Saved flash message

Viewed 2765

In order to make a little yellow "Saving"/"Saved" indicator message at the top of my app, I'd like to have a boolean property indicating if any ember-data records are currently in flight.

I tried this:

App.store = DS.Store.create
  isSaving: (->
    for record in this.get('recordCache')
      if record?.getPath('stateManager.currentState.name') == 'inFlight'
        return true
    return false
  ).property('recordCache.@each.stateManager.currentState.name')

but then I discovered that recordCache is not observable.

I don't use transactions, only App.store.commit(), so I looked at App.store.get('defaultTransaction'), but it didn't yield anything useful.

I'm using the RESTAdapter, so if I can extend it into giving me this piece of information, that would work too.

3 Answers
Related