Created
May 5, 2018 13:47
-
-
Save rozkminiacz/99faec9a08259868618e9649f779401c to your computer and use it in GitHub Desktop.
This file contains 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
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