mirror of
https://github.com/apple/swift-async-algorithms
synced 2026-11-25 04:27:48 +00:00
fix merge example (#140)
This commit is contained in:
1 parent
b6755e6313
commit
c174e4603e
1 file changed
+3
-3
+3
-3
@@ -6,10 +6,10 @@
|
||||
Merges two or more asynchronous sequences sharing the same element type into one singular asynchronous sequence.
|
||||
|
||||
```swift
|
||||
let appleFeed = URL("http://www.example.com/ticker?symbol=AAPL").lines.map { "AAPL: " + $0 }
|
||||
let nasdaqFeed = URL("http://www.example.com/ticker?symbol=^IXIC").lines.map { "^IXIC: " + $0 }
|
||||
let appleFeed = URL(string: "http://www.example.com/ticker?symbol=AAPL")!.lines.map { "AAPL: " + $0 }
|
||||
let nasdaqFeed = URL(string:"http://www.example.com/ticker?symbol=^IXIC")!.lines.map { "^IXIC: " + $0 }
|
||||
|
||||
for try await ticker = merge(appleFeed, nasdaqFeed) {
|
||||
for try await ticker in merge(appleFeed, nasdaqFeed) {
|
||||
print(ticker)
|
||||
}
|
||||
```
|
||||
|
||||
Reference in new issue
Block a user