@data-weave/backend-firestore 0.6.3 → 0.7.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -64,6 +64,10 @@ class FirestoreList extends datamanager_1.LiveList {
64
64
  this.onUpdateAll(newValues);
65
65
  }
66
66
  handleSubsequentDataChanges(changes) {
67
+ // Each index-based mutation on `LiveList` already fires `onUpdate`
68
+ // (and therefore `onValuesChange` and the `options.onUpdate`
69
+ // callback). No trailing notification is needed; consumers see one
70
+ // notification per change in the batch.
67
71
  changes.forEach(change => {
68
72
  if (change.type === 'added') {
69
73
  this.onAddAtIndex(change.newIndex, change.doc.data());
@@ -75,8 +79,6 @@ class FirestoreList extends datamanager_1.LiveList {
75
79
  this.onRemoveAtIndex(change.oldIndex);
76
80
  }
77
81
  });
78
- // TODO: handle onUpdate in the parent class - make sure it's only called once after all changes are processed
79
- this.onUpdate();
80
82
  }
81
83
  unsubscribe() {
82
84
  this.unsubscribeFromSnapshot?.();
@@ -63,7 +63,7 @@ class FirestoreReference extends datamanager_1.LiveReference {
63
63
  }
64
64
  unsubscribe() {
65
65
  this.unsubscribeFromSnapshot?.();
66
- this.setStale();
66
+ this.onStale();
67
67
  }
68
68
  parseDocumentSnapshot(docSnapshot) {
69
69
  if (!(0, utils_1.checkIfReferenceExists)(docSnapshot))
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@data-weave/backend-firestore",
3
- "version": "0.6.3",
3
+ "version": "0.7.0",
4
4
  "author": "",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -23,7 +23,7 @@
23
23
  "registry": "https://registry.npmjs.org/"
24
24
  },
25
25
  "devDependencies": {
26
- "@data-weave/datamanager": "~0.6.3",
26
+ "@data-weave/datamanager": "~0.7.0",
27
27
  "@firebase/firestore": "^4.7.8",
28
28
  "@firebase/functions-types": "^0.6.3",
29
29
  "@google-cloud/firestore": "^7.11.1",