-
-
Save ahinchman1/055466ed04f8e3dd5adf16fb79e3eb05 to your computer and use it in GitHub Desktop.
ActivityPresenter with two leaks
This file contains hidden or 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
class ActivityPresenter @Inject constructor( | |
private val repository: SomeRepository | |
) : BasePresenter<ActivityView>() { | |
/* removed for brevity */ | |
private val viewDisposable = CompositeDisposable() | |
override fun attachView(view: ActivityView?) { | |
super.attachView(view) | |
val disposable = repository.doSomeHeavyWorkAndReturnState() | |
.subscribeOn(Schedulers.io()) | |
.subscribe { viewState.render(it) } | |
viewDisposable.add(disposable) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment