Update moxy
parent
a2a0e62b47
commit
e6befc57e0
@ -1,22 +1,7 @@
|
||||
package org.koitharu.kotatsu.ui.common
|
||||
|
||||
import kotlinx.coroutines.CoroutineScope
|
||||
import kotlinx.coroutines.Dispatchers
|
||||
import kotlinx.coroutines.SupervisorJob
|
||||
import moxy.MvpPresenter
|
||||
import moxy.MvpView
|
||||
import org.koin.core.KoinComponent
|
||||
import kotlin.coroutines.CoroutineContext
|
||||
|
||||
abstract class BasePresenter<V : MvpView> : MvpPresenter<V>(), KoinComponent, CoroutineScope {
|
||||
|
||||
private val job = SupervisorJob()
|
||||
|
||||
override val coroutineContext: CoroutineContext
|
||||
get() = Dispatchers.Main + job
|
||||
|
||||
override fun onDestroy() {
|
||||
job.cancel()
|
||||
super.onDestroy()
|
||||
}
|
||||
}
|
||||
abstract class BasePresenter<V : MvpView> : MvpPresenter<V>(), KoinComponent
|
||||
Loading…
Reference in New Issue