1
votes

How does one unload an embedded record in Ember Data?

This jsbin illustrates that:

this.store.unloadRecord(record);

works on the parent record but not on the embedded child record (documented here).

Is there another way to remove the embedded child record from the store without sending a delete request to the server?

1
What would this mean? It would seem to leave the parent model instance in a semi-broken state, missing its children. When and how would they expect to be reloaded?user663031
@torazaburo: I don't require them to be reloaded, only unloaded.TrevTheDev

1 Answers

1
votes

There isn't a way to do that (at least no documented way to do it). The reason is that embedded records are not really records. It's convenient terminology, but it's not true. Embedded records are really more like attributes than records in the sense that they are attached to their parent record. They can't stand on their own because they have no identity on their own, and they can be detached from their parent because then the parent is incomplete.

I'm not sure what your use case is, but if you no longer need the data, my advice would be to just not use it.