We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent da5233c commit 91a4ddaCopy full SHA for 91a4dda
lib/client/ground.db.js
@@ -343,12 +343,13 @@ Ground.Collection = class GroundCollection {
343
// Map each cursor id's into one flat array
344
const keepIds = arrayOfCursors.map((cursor) => cursor.map((doc) => strId(doc._id))).flat();
345
// Remove all other documents from the collection
346
- difference(currentIds, keepIds).forEach((id) => {
+ const arrays = [currentIds, keepIds];
347
+ for (const id of arrays.reduce((a, b) => a.filter((c) => !b.includes(c)))) {
348
// Remove it from in memory
349
delete this._collection._docs._map[id];
350
// Remove it from storage
351
this.saveDocument({ _id: id }, true);
- });
352
+ }
353
354
this.invalidate();
355
}
0 commit comments