-
Notifications
You must be signed in to change notification settings - Fork 138
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
zip
is not Rx compatible
#116
Comments
I don't think the example is correct. func test_zip() async {
let a = [1, 1, 2, 2]
let b = ["a", "b", "c", "d"]
let expected = Array(zip(a, b))
let actual = await Array(zip(a.async, b.async))
XCTAssertEqual(expected, actual)
}
// expected result: [(1, "a"), (1, "b"), (2, "c"), (2, "d")] The marble diagram from ReactiveX demonstrates this behavior pretty well: https://reactivex.io/documentation/operators/zip.html |
@DevAndArtist |
I don't understand.
|
If you need a result that looks more like this:
then you'd need to extend both async sequences with something like let zipped = zip(countUpStream.removeDuplicates(), countUpStream2.removeDuplicates()) |
Ah, my bad. The example was a too complicated (using less than 1 sec interval that causes duplicated same seconds). |
Added simpler example issue in: |
Result:
To Be:
The text was updated successfully, but these errors were encountered: