2

I'm looking at implementing Model.sync.deleteRecord() for use with Ember-Data Basic Adaptor.

According to the docs, adapter must call didDeleteRecord() once record has been successfully deleted from the server.

However, I can't find good example on how to actually call didDeleteRecord(). After looking at the source, the best I come up with this:

    deleteRecord: function(record, process) {
        my_api.remove(record.get('id')).then(function() {
            var r = process(record);
            r.store.adapter.didDeleteRecord(r.store, r.type, r.record);
        });
    }

Is there any better, less uglier ways to call didDeleteRecord()?

CraigTeegarden
  • 8,173
  • 8
  • 38
  • 43
anton
  • 31
  • 2

0 Answers0