Last active
September 9, 2021 17:03
-
-
Save ericntd/8737183d9a70eca33d7643eb2b04ddfc 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
private val viewState = MutableLiveData<ViewState>() | |
private var someUsefulVariable: Int? = null // mutable! | |
init { | |
doStep1() | |
//... | |
.doStepK() | |
.map { stepKResult -> | |
someUsefulVariable = ... // derived from stepKresult | |
return@map processData(stepKResult, someUsefulVariable) | |
} | |
//... | |
.handleResult { finalResult -> | |
viewState.value = ViewState.DataLoaded(...) | |
} | |
} | |
internal fun onActivityResult() { | |
//... | |
someUsefulVariable = -1 // random value here, no particular meaning | |
} | |
internal fun onRefreshed() { | |
//... | |
someUsefulVariable = null // random value here, no particular meaning | |
} | |
internal fun onSomeButtonClicked() { | |
//... | |
someUsefulVariable = 0 // random value here, no particular meaning | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment