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 {
2626 /// An asynchronous sequence of document snapshots.
2727 ///
2828 /// 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 > {
3031 return snapshots ( includeMetadataChanges: false )
3132 }
3233
3334 /// An asynchronous sequence of document snapshots.
3435 ///
3536 /// - Parameter includeMetadataChanges: Whether to receive events for metadata-only changes.
3637 /// - 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 > {
3840 return AsyncThrowingStream { continuation in
3941 let listener = self
4042 . addSnapshotListener ( includeMetadataChanges: includeMetadataChanges) { snapshot, error in
Original file line number Diff line number Diff line change @@ -26,15 +26,17 @@ public extension Query {
2626 /// An asynchronous sequence of query snapshots.
2727 ///
2828 /// 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 > {
3031 return snapshots ( includeMetadataChanges: false )
3132 }
3233
3334 /// An asynchronous sequence of query snapshots.
3435 ///
3536 /// - Parameter includeMetadataChanges: Whether to receive events for metadata-only changes.
3637 /// - 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 > {
3840 return AsyncThrowingStream { continuation in
3941 let listener = self
4042 . addSnapshotListener ( includeMetadataChanges: includeMetadataChanges) { snapshot, error in
You can’t perform that action at this time.
0 commit comments