Skip to content

Commit 697b6d4

Browse files
committed
Use EventsAccumulator
1 parent 8238cce commit 697b6d4

File tree

2 files changed

+131
-180
lines changed

2 files changed

+131
-180
lines changed

packages/firestore/src/api/reference_impl.ts

+9-11
Original file line numberDiff line numberDiff line change
@@ -1182,13 +1182,14 @@ function onSnapshotDocumentSnapshotBundle<
11821182
): Unsubscribe {
11831183
let unsubscribed: boolean = false;
11841184
let internalUnsubscribe: Unsubscribe | undefined;
1185-
const bundle = json.bundle;
1186-
const loadTask = loadBundle(db, bundle);
1185+
const loadTask = loadBundle(db, json.bundle);
11871186
loadTask
11881187
.then(() => {
1189-
const key = DocumentKey.fromPath(json.bundleName);
1190-
const docConverter = converter ? converter : null;
1191-
const docReference = new DocumentReference(db, docConverter, key);
1188+
const docReference = new DocumentReference(
1189+
db,
1190+
converter ? converter : null,
1191+
DocumentKey.fromPath(json.bundleName)
1192+
);
11921193
if (options !== undefined) {
11931194
internalUnsubscribe = onSnapshot(
11941195
docReference as DocumentReference<AppModelType, DbModelType>,
@@ -1205,9 +1206,8 @@ function onSnapshotDocumentSnapshotBundle<
12051206
.catch(e => {
12061207
if (observer.error) {
12071208
observer.error(e);
1208-
} else {
1209-
throw e;
12101209
}
1210+
return () => {};
12111211
});
12121212
return () => {
12131213
if (unsubscribed) {
@@ -1238,8 +1238,7 @@ function onSnapshotQuerySnapshotBundle<
12381238
): Unsubscribe {
12391239
let unsubscribed: boolean = false;
12401240
let internalUnsubscribe: Unsubscribe | undefined;
1241-
const bundle = json.bundle;
1242-
const loadTask = loadBundle(db, bundle);
1241+
const loadTask = loadBundle(db, json.bundle);
12431242
loadTask
12441243
.then(() => namedQuery(db, json.bundleName))
12451244
.then(query => {
@@ -1265,9 +1264,8 @@ function onSnapshotQuerySnapshotBundle<
12651264
.catch(e => {
12661265
if (observer.error) {
12671266
observer.error(e);
1268-
} else {
1269-
throw e;
12701267
}
1268+
return () => {};
12711269
});
12721270
return () => {
12731271
if (unsubscribed) {

0 commit comments

Comments
 (0)