Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
class PromotionListViewRobot(presenter: PromotionListContract.Presenter) {
private val initSubject = BehaviorSubject.create<Any>()
private val renderedViewStates: MutableList<PromotionListContract.ViewState> = mutableListOf()
private val view: PromotionListContract.View = object : PromotionListContract.View {
override fun listInit(): Observable<Any> = initSubject
override fun render(viewState: PromotionListContract.ViewState) {
renderedViewStates.add(viewState)
}
}
init {
presenter.attachView(view)
}
fun start() {
initSubject.onNext(Any())
}
fun checkStatesRendered(function: (List<PromotionListContract.ViewState>) -> Unit) {
function(renderedViewStates)
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment