mirror of
https://github.com/apple/swift-async-algorithms
synced 2026-11-29 04:54:21 +00:00
Fix zip example (#119)
This commit is contained in:
1 parent
0dfb244b1b
commit
739815f65d
1 file changed
+3
-3
+3
-3
@@ -6,10 +6,10 @@
|
||||
Combines the latest values produced from two or more asynchronous sequences into an asynchronous sequence of tuples.
|
||||
|
||||
```swift
|
||||
let appleFeed = URL("http://www.example.com/ticker?symbol=AAPL").lines
|
||||
let nasdaqFeed = URL("http://www.example.com/ticker?symbol=^IXIC").lines
|
||||
let appleFeed = URL(string: "http://www.example.com/ticker?symbol=AAPL")!.lines
|
||||
let nasdaqFeed = URL(string: "http://www.example.com/ticker?symbol=^IXIC")!.lines
|
||||
|
||||
for try await (apple, nasdaq) = zip(appleFeed, nasdaqFeed) {
|
||||
for try await (apple, nasdaq) in zip(appleFeed, nasdaqFeed) {
|
||||
print("APPL: \(apple) NASDAQ: \(nasdaq)")
|
||||
}
|
||||
```
|
||||
|
||||
Reference in new issue
Block a user