Skip to content

Commit b7999a9

Browse files
Append to previous result
1 parent 5252485 commit b7999a9

File tree

2 files changed

+7
-19
lines changed

2 files changed

+7
-19
lines changed

packages/firestore/src/local/query_engine.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ import {
3939
} from '../model/field_index';
4040
import { debugAssert } from '../util/assert';
4141
import { getLogLevel, logDebug, LogLevel } from '../util/log';
42-
import { ValueIterable, values } from '../util/misc';
42+
import { Iterable } from '../util/misc';
4343
import { SortedSet } from '../util/sorted_set';
4444

4545
import { IndexManager, IndexType } from './index_manager';
@@ -209,7 +209,7 @@ export class QueryEngine {
209209

210210
return this.appendRemainingResults(
211211
transaction,
212-
values(indexedDocuments),
212+
previousResults,
213213
query,
214214
offset
215215
) as PersistencePromise<DocumentMap | null>;
@@ -373,7 +373,7 @@ export class QueryEngine {
373373
*/
374374
private appendRemainingResults(
375375
transaction: PersistenceTransaction,
376-
indexedResults: ValueIterable<Document>,
376+
indexedResults: Iterable<Document>,
377377
query: Query,
378378
offset: IndexOffset
379379
): PersistencePromise<DocumentMap> {

packages/firestore/src/util/misc.ts

Lines changed: 4 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,10 @@ export interface Equatable<T> {
6868
isEqual(other: T): boolean;
6969
}
7070

71+
export interface Iterable<V> {
72+
forEach: (cb: (v: V) => void) => void;
73+
}
74+
7175
/** Helper to compare arrays using isEqual(). */
7276
export function arrayEquals<T>(
7377
left: T[],
@@ -87,19 +91,3 @@ export function immediateSuccessor(s: string): string {
8791
// Return the input string, with an additional NUL byte appended.
8892
return s + '\0';
8993
}
90-
91-
export interface ValueIterable<V> {
92-
forEach: (cb: (v: V) => void) => void;
93-
}
94-
95-
/**
96-
* Exposes a `forEach(value)` method on objects that provide an
97-
* `forEach(key, value)` iterator.
98-
*/
99-
export function values<K, V>(iterable: {
100-
forEach: (cb: (k: K, v: V) => void) => void;
101-
}): ValueIterable<V> {
102-
return {
103-
forEach: cb => iterable.forEach((k, v) => cb(v))
104-
};
105-
}

0 commit comments

Comments
 (0)