Skip to content

Commit 4fae282

Browse files
committed
Additional cleanup of sum/avg
1 parent de2a95a commit 4fae282

File tree

3 files changed

+5
-19
lines changed

3 files changed

+5
-19
lines changed

packages/firestore/src/core/aggregate.ts

Lines changed: 2 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ import { FieldPath } from '../model/path';
2424
export type AggregateType = 'count' | 'avg' | 'sum';
2525

2626
/**
27-
* TODO
27+
* Represents an Aggregate to be performed over a query result set.
2828
*/
2929
export interface Aggregate {
3030
readonly fieldPath?: FieldPath;
@@ -33,7 +33,7 @@ export interface Aggregate {
3333
}
3434

3535
/**
36-
* TODO
36+
* Concrete implementation of the Aggregate type.
3737
*/
3838
export class AggregateImpl implements Aggregate {
3939
constructor(
@@ -42,17 +42,3 @@ export class AggregateImpl implements Aggregate {
4242
readonly fieldPath?: FieldPath
4343
) {}
4444
}
45-
46-
/**
47-
* TODO
48-
* @param alias
49-
* @param aggregateType
50-
* @param fieldPath
51-
*/
52-
export function newAggregate(
53-
alias: string,
54-
aggregateType: AggregateType,
55-
fieldPath?: FieldPath
56-
): Aggregate {
57-
return new AggregateImpl(alias, aggregateType, fieldPath);
58-
}

packages/firestore/src/core/firestore_client.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -448,7 +448,7 @@ export function firestoreClientRunAggregateQuery(
448448
const deferred = new Deferred<ObjectValue>();
449449

450450
client.asyncQueue.enqueueAndForget(async () => {
451-
// TODO(aggregates) update this to use the event manager.
451+
// TODO (sum/avg) should we update this to use the event manager?
452452
// Implement and call executeAggregateQueryViaSnapshotListener, similar
453453
// to the implementation in firestoreClientGetDocumentsViaSnapshotListener
454454
// above

packages/firestore/src/lite-api/aggregate_types.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,12 +28,12 @@ export { AggregateType };
2828
* Represents an aggregation that can be performed by Firestore.
2929
*/
3030
// eslint-disable-next-line @typescript-eslint/no-unused-vars
31-
export class AggregateField<R> {
31+
export class AggregateField<T> {
3232
/** A type string to uniquely identify instances of this class. */
3333
readonly type = 'AggregateField';
3434

3535
/**
36-
* Create a new AggregateField<R>
36+
* Create a new AggregateField<T>
3737
* @param _aggregateType Specifies the type of aggregation operation to perform.
3838
* @param _internalFieldPath Optionally specifies the field that is aggregated.
3939
* @internal

0 commit comments

Comments
 (0)