Skip to content

Instantly share code, notes, and snippets.

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