Created
April 26, 2020 07:23
-
-
Save inamiy/55e4bdd2923eb660cc063d77b2a26b0d to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Just(()) | |
.delay(for: 1, scheduler: DispatchQueue.main) | |
.sink { | |
print("Q1. Can you hear me?") // Yes, even without retaining cancellable. Do you know why? :) | |
} | |
Just(()) | |
.delay(for: 1, scheduler: DispatchQueue.main) | |
.flatMap { Just(()) } | |
.sink { | |
print("Q2. Can you hear me?") // No, because of not retaining cancellable | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment