Conversation
|
So one thing that we should look into if we want to add it: This currently does not handle saving deletions from the top level store, this is supported on the binder API level in the multiput (next to However this means we should start to keep track on the store which ids have been removed from it. (Or which ids it originally had and on save just check which ones are not in there anymore) |
Codecov Report
@@ Coverage Diff @@
## master #134 +/- ##
==========================================
+ Coverage 93.63% 93.75% +0.12%
==========================================
Files 5 5
Lines 848 865 +17
Branches 201 204 +3
==========================================
+ Hits 794 811 +17
Misses 44 44
Partials 10 10
Continue to review full report at Codecov.
|
eeb7cab to
92f1db6
Compare
| const promises = []; | ||
| for (const model of this.models) { | ||
| promises.push(model._afterSaveAll(res, options)); | ||
| } | ||
| return Promise.all(promises); |
There was a problem hiding this comment.
It should also call this.clearSetChanges after successful save, otherwise this.hasUserChanges will always stay true even after saving the store. I encountered this issue in a project that already uses changes from this PR
Added .save function to stores.
It uses logic from single model and applies it to the whole store.
Tests added based on the model tests.