- 
                Notifications
    
You must be signed in to change notification settings  - Fork 15
 
Adding store save #134
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Adding store save #134
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.