Skip to content

Commit 45a1b93

Browse files
committed
fix: migrate firestore helpers
1 parent 18e6e3a commit 45a1b93

File tree

1 file changed

+9
-5
lines changed

1 file changed

+9
-5
lines changed

firestore/helpers/index.ts

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,12 @@
1-
import firebase from 'firebase/app';
1+
import {
2+
DocumentData,
3+
DocumentSnapshot,
4+
SnapshotOptions,
5+
} from 'firebase/firestore';
26

3-
export const snapshotToData = <T = firebase.firestore.DocumentData>(
4-
snapshot: firebase.firestore.DocumentSnapshot,
5-
snapshotOptions?: firebase.firestore.SnapshotOptions,
7+
export const snapshotToData = <T = DocumentData>(
8+
snapshot: DocumentSnapshot,
9+
snapshotOptions?: SnapshotOptions,
610
idField?: string,
711
refField?: string,
812
transform?: (val: any) => T
@@ -11,7 +15,7 @@ export const snapshotToData = <T = firebase.firestore.DocumentData>(
1115
return undefined;
1216
}
1317

14-
let data = snapshot.data(snapshotOptions) as firebase.firestore.DocumentData;
18+
let data = snapshot.data(snapshotOptions) as DocumentData;
1519
if (transform) {
1620
data = transform(data);
1721
}

0 commit comments

Comments
 (0)