Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
interface PromotionListContract {
interface View : MvpView {
fun listInit(): Observable<Any>
fun render(viewState: ViewState)
}
abstract class Presenter : MviBasePresenter<View, ViewState>()
data class ViewState(
val promotionList: List<PromotionViewModel> = emptyList(),
val showError: Boolean = false,
val showLoading: Boolean = false,
val error: Error = Error())
interface Interactor {
fun getPromotions(): Observable<PartialViewState>
}
sealed class PartialViewState {
object Loading : PartialViewState()
data class PromotionList(val list: List<PromotionViewModel>) : PartialViewState()
data class Error(val reason: kotlin.Error) : PartialViewState()
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment