Skip to content

Instantly share code, notes, and snippets.

@andreyfomenkov
Created December 20, 2020 18:16
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save andreyfomenkov/bdf66f3cdee586aa253423857fa48e6e to your computer and use it in GitHub Desktop.
Save andreyfomenkov/bdf66f3cdee586aa253423857fa48e6e to your computer and use it in GitHub Desktop.
Leaked subscription
class WeatherActivity : AppCompatActivity() {
private val thermometer = Thermometer.getInstance()
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
thermometer
.observeTemperature()
.subscribe { celsius -> /* Display in a TextView */ }
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment