How to avoid the error "loaded.created.uncommitted" when performing an unloadAll operation with ember data?

My application creates many “configuration” models (that is, they live only in the application at runtime, and they will never be saved). I download them on demand, so my application constantly creates entries and then discards them.

//create a record that will never be persisted
this.store.createRecord('foo', {name: 'wat'});

In the past, I just did everything that was in the store, but I realized that this actually doesn’t “delete” anything. I decided to use unloadAll instead

this.store.unloadAll('foo');

... but I ran into this error because I have these "configurations" of models

Error loading route: Error: attempting to process an event unloadRecordwhile in the root.loaded.created.uncommitted state. on a new error (native)

( unloadAll, )?

+4
1

( ) PR, 2 :

. https://github.com/emberjs/data/pull/1714

PR , , inFlight. , .

PR, , . , .

, () PR , .

+3

Source: https://habr.com/ru/post/1527149/


All Articles