Skip to content

Commit 099f42d

Browse files
committed
Add additional docs for extension methods and AsyncCombineLatest2Sequence structure
1 parent 5b5d91c commit 099f42d

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

Sources/AsyncAlgorithms/AsyncCombineLatest2Sequence.swift

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,13 @@
99
//
1010
//===----------------------------------------------------------------------===//
1111

12+
/// Creates an asynchronous sequence that combines the latest values from two `AsyncSequence` types
13+
/// by emitting a tuple of the values.
1214
public func combineLatest<Base1: AsyncSequence, Base2: AsyncSequence>(_ base1: Base1, _ base2: Base2) -> AsyncCombineLatest2Sequence<Base1, Base2> {
1315
AsyncCombineLatest2Sequence(base1, base2)
1416
}
1517

18+
/// An `AsyncSequence` that combines the latest values produced from two asynchronous sequences into an asynchronous sequence of tuples.
1619
public struct AsyncCombineLatest2Sequence<Base1: AsyncSequence, Base2: AsyncSequence>: Sendable
1720
where
1821
Base1: Sendable, Base2: Sendable,
@@ -27,7 +30,6 @@ public struct AsyncCombineLatest2Sequence<Base1: AsyncSequence, Base2: AsyncSequ
2730
}
2831
}
2932

30-
/// An `AsyncSequence` that combines the latest values produced from two asynchronous sequences into an asynchronous sequence of tuples.
3133
extension AsyncCombineLatest2Sequence: AsyncSequence {
3234
public typealias Element = (Base1.Element, Base2.Element)
3335

Sources/AsyncAlgorithms/AsyncCombineLatest3Sequence.swift

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@
99
//
1010
//===----------------------------------------------------------------------===//
1111

12+
/// Creates an asynchronous sequence that combines the latest values from three `AsyncSequence` types
13+
/// by emitting a tuple of the values.
1214
public func combineLatest<Base1: AsyncSequence, Base2: AsyncSequence, Base3: AsyncSequence>(_ base1: Base1, _ base2: Base2, _ base3: Base3) -> AsyncCombineLatest3Sequence<Base1, Base2, Base3> {
1315
AsyncCombineLatest3Sequence(base1, base2, base3)
1416
}

0 commit comments

Comments
 (0)