Skip to content

Commit d2fc594

Browse files
Change argument order
1 parent a4059b1 commit d2fc594

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

packages/firestore/lite/src/api/reference.ts

+10-10
Original file line numberDiff line numberDiff line change
@@ -109,8 +109,8 @@ export class DocumentReference<T = firestore.DocumentData>
109109
get parent(): CollectionReference<T> {
110110
return new CollectionReference<T>(
111111
this.firestore,
112-
this._key.path.popLast(),
113-
this._converter
112+
this._converter,
113+
this._key.path.popLast()
114114
);
115115
}
116116

@@ -122,8 +122,8 @@ export class DocumentReference<T = firestore.DocumentData>
122122
validateCollectionPath(absolutePath);
123123
return new CollectionReference(
124124
this.firestore,
125-
absolutePath,
126-
/* converter= */ null
125+
/* converter= */ null,
126+
absolutePath
127127
);
128128
}
129129

@@ -389,8 +389,8 @@ export class CollectionReference<T = firestore.DocumentData>
389389

390390
constructor(
391391
readonly firestore: Firestore,
392-
readonly _path: ResourcePath,
393-
converter: firestore.FirestoreDataConverter<T> | null
392+
converter: firestore.FirestoreDataConverter<T> | null,
393+
readonly _path: ResourcePath
394394
) {
395395
super(firestore, converter, newQueryForPath(_path));
396396
}
@@ -431,7 +431,7 @@ export class CollectionReference<T = firestore.DocumentData>
431431
withConverter<U>(
432432
converter: firestore.FirestoreDataConverter<U>
433433
): firestore.CollectionReference<U> {
434-
return new CollectionReference<U>(this.firestore, this._path, converter);
434+
return new CollectionReference<U>(this.firestore, converter, this._path);
435435
}
436436
}
437437

@@ -458,7 +458,7 @@ export function collection(
458458
if (parent instanceof Firestore) {
459459
const absolutePath = ResourcePath.fromString(relativePath);
460460
validateCollectionPath(absolutePath);
461-
return new CollectionReference(parent, absolutePath, /* converter= */ null);
461+
return new CollectionReference(parent, /* converter= */ null, absolutePath);
462462
} else {
463463
if (
464464
!(parent instanceof DocumentReference) &&
@@ -476,8 +476,8 @@ export function collection(
476476
validateCollectionPath(absolutePath);
477477
return new CollectionReference(
478478
parent.firestore,
479-
absolutePath,
480-
/* converter= */ null
479+
/* converter= */ null,
480+
absolutePath
481481
);
482482
}
483483
}

0 commit comments

Comments
 (0)