I am trying to achieve something that, it seems to me, has a simple answer, but for some reason I cannot find it by reading the source code of ember-data .
I would like to trigger an action after a specific set of changes has been made to the data warehouse. This is my current code:
var transaction = App.store.transaction(); user = App.get('currentUser'); transaction.add(user); user.set('name', "Michael Jackson"); transaction.commit(); App.navigate('dashboard');
My first attempt was to add an observer to this isDirty custom property, but a) it does not look idiomatic and, more importantly, b) I would have to manually remove this observer at the end - which is error prone if some exception occurs between they are not deleted, for example.
Any ideas? How do you do this?
josepjaume
source share