(...args: OnSnapshotParameters<QuerySnapshot>)
| 511 | onSnapshot(onNext: (snapshot: QuerySnapshot) => void, onError?: (error: Error) => void, onCompletion?: () => void): () => void; |
| 512 | onSnapshot(options: SnapshotListenOptions, onNext: (snapshot: QuerySnapshot) => void, onError?: (error: Error) => void, onCompletion?: () => void): () => void; |
| 513 | onSnapshot(...args: OnSnapshotParameters<QuerySnapshot>): () => void { |
| 514 | const { includeMetadataChanges, ...handlers } = parseOnSnapshotArgs(args); |
| 515 | |
| 516 | const listener = this.native.addSnapshotListener( |
| 517 | includeMetadataChanges ? com.google.firebase.firestore.MetadataChanges.INCLUDE : com.google.firebase.firestore.MetadataChanges.EXCLUDE, |
| 518 | new com.google.firebase.firestore.EventListener<com.google.firebase.firestore.QuerySnapshot>({ |
| 519 | onEvent(querySnapshot, error: com.google.firebase.firestore.FirebaseFirestoreException) { |
| 520 | if (error) { |
| 521 | handlers.error?.(FirebaseError.fromNative(error)); |
| 522 | } else { |
| 523 | handlers.next?.(QuerySnapshot.fromNative(querySnapshot)); |
| 524 | } |
| 525 | }, |
| 526 | }) |
| 527 | ); |
| 528 | return () => listener?.remove?.(); |
| 529 | } |
| 530 | |
| 531 | orderBy(fieldPath: keyof DocumentData | FieldPath, directionStr: 'asc' | 'desc' = 'asc'): Query { |
| 532 | if (fieldPath instanceof FieldPath) { |
nothing calls this directly
no test coverage detected