To make a small yellow “Save” / “Saved” message at the top of my application, I would like to have a boolean property indicating whether any data records of ember data are currently located.
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 found that recordCache
not observed.
I do not use transactions, only App.store.commit()
, so I looked at App.store.get('defaultTransaction')
, but brought nothing useful.
I am using RESTAdapter, so if I can expand it by providing me this information, this will work too.
source share