File tree Expand file tree Collapse file tree 2 files changed +8
-4
lines changed
Firestore/Swift/Source/AsyncAwait Expand file tree Collapse file tree 2 files changed +8
-4
lines changed Original file line number Diff line number Diff line change @@ -26,15 +26,17 @@ public extension DocumentReference {
26
26
/// An asynchronous sequence of document snapshots.
27
27
///
28
28
/// This stream emits a new `DocumentSnapshot` every time the underlying data changes.
29
- var snapshots : AsyncThrowingStream < DocumentSnapshot , Error > {
29
+ @available ( iOS 18 . 0 , * )
30
+ var snapshots : some AsyncSequence < DocumentSnapshot , Error > {
30
31
return snapshots ( includeMetadataChanges: false )
31
32
}
32
33
33
34
/// An asynchronous sequence of document snapshots.
34
35
///
35
36
/// - Parameter includeMetadataChanges: Whether to receive events for metadata-only changes.
36
37
/// - Returns: An `AsyncThrowingStream` of `DocumentSnapshot` events.
37
- func snapshots( includeMetadataChanges: Bool ) -> AsyncThrowingStream < DocumentSnapshot , Error > {
38
+ @available ( iOS 18 . 0 , * )
39
+ func snapshots( includeMetadataChanges: Bool ) -> some AsyncSequence < DocumentSnapshot , Error > {
38
40
return AsyncThrowingStream { continuation in
39
41
let listener = self
40
42
. addSnapshotListener ( includeMetadataChanges: includeMetadataChanges) { snapshot, error in
Original file line number Diff line number Diff line change @@ -26,15 +26,17 @@ public extension Query {
26
26
/// An asynchronous sequence of query snapshots.
27
27
///
28
28
/// This stream emits a new `QuerySnapshot` every time the underlying data changes.
29
- var snapshots : AsyncThrowingStream < QuerySnapshot , Error > {
29
+ @available ( iOS 18 . 0 , * )
30
+ var snapshots : some AsyncSequence < QuerySnapshot , Error > {
30
31
return snapshots ( includeMetadataChanges: false )
31
32
}
32
33
33
34
/// An asynchronous sequence of query snapshots.
34
35
///
35
36
/// - Parameter includeMetadataChanges: Whether to receive events for metadata-only changes.
36
37
/// - Returns: An `AsyncThrowingStream` of `QuerySnapshot` events.
37
- func snapshots( includeMetadataChanges: Bool ) -> AsyncThrowingStream < QuerySnapshot , Error > {
38
+ @available ( iOS 18 . 0 , * )
39
+ func snapshots( includeMetadataChanges: Bool ) -> some AsyncSequence < QuerySnapshot , Error > {
38
40
return AsyncThrowingStream { continuation in
39
41
let listener = self
40
42
. addSnapshotListener ( includeMetadataChanges: includeMetadataChanges) { snapshot, error in
You can’t perform that action at this time.
0 commit comments