Skip to content

Instantly share code, notes, and snippets.

@inamiy
Created April 26, 2020 07:23
Show Gist options
  • Save inamiy/55e4bdd2923eb660cc063d77b2a26b0d to your computer and use it in GitHub Desktop.
Save inamiy/55e4bdd2923eb660cc063d77b2a26b0d to your computer and use it in GitHub Desktop.
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