(...args: OnSnapshotParameters<QuerySnapshot>)
| 455 | onSnapshot(onNext: (snapshot: QuerySnapshot) => void, onError?: (error: Error) => void, onCompletion?: () => void): () => void; |
| 456 | onSnapshot(options: SnapshotListenOptions, onNext: (snapshot: QuerySnapshot) => void, onError?: (error: Error) => void, onCompletion?: () => void): () => void; |
| 457 | onSnapshot(...args: OnSnapshotParameters<QuerySnapshot>): () => void { |
| 458 | const { includeMetadataChanges, ...handlers } = parseOnSnapshotArgs(args); |
| 459 | |
| 460 | const listener = this.native.addSnapshotListenerWithIncludeMetadataChangesListener(includeMetadataChanges, (querySnapshot, error) => { |
| 461 | if (error) { |
| 462 | handlers.error?.(FirebaseError.fromNative(error)); |
| 463 | } else { |
| 464 | handlers.next?.(QuerySnapshot.fromNative(querySnapshot)); |
| 465 | } |
| 466 | }); |
| 467 | |
| 468 | return () => listener?.remove?.(); |
| 469 | } |
| 470 | |
| 471 | orderBy(fieldPath: keyof DocumentData | FieldPath, directionStr: 'asc' | 'desc' = 'asc'): Query { |
| 472 | if (fieldPath instanceof FieldPath) { |
nothing calls this directly
no test coverage detected