Skip to content
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

Add flag to force saving sync store #956

Merged
merged 1 commit into from
Jun 14, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions src/store/indexeddb.js
Original file line number Diff line number Diff line change
Expand Up @@ -198,11 +198,13 @@ IndexedDBStore.prototype.wantsSave = function() {

/**
* Possibly write data to the database.
*
* @param {bool} force True to force a save to happen
* @return {Promise} Promise resolves after the write completes
* (or immediately if no write is performed)
*/
IndexedDBStore.prototype.save = function() {
if (this.wantsSave()) {
IndexedDBStore.prototype.save = function(force) {
if (force || this.wantsSave()) {
return this._reallySave();
}
return Promise.resolve();
Expand Down
4 changes: 3 additions & 1 deletion src/store/memory.js
Original file line number Diff line number Diff line change
Expand Up @@ -335,8 +335,10 @@ module.exports.MemoryStore.prototype = {

/**
* Save does nothing as there is no backing data store.
* @param {bool} force True to force a save (but the memory
* store still can't save anything)
*/
save: function() {},
save: function(force) {},

/**
* Startup does nothing as this store doesn't require starting up.
Expand Down