ThunkContextNoAction
data class ThunkContextNoAction<State, Action, Proposal>(val getState: GetState<State>, val dispatch: Dispatcher<Action>, val reduce: suspend (proposal: Proposal) -> Unit, launchBlock: Launch)
ThunkContextNoAction is used as receiver for the thunk defined MVVM+ style (no action):
fun doSomething() = thunk {
}
Content copied to clipboard
Parameters
getState
returns the current state
dispatch
dispatches an action
reduce
reduces a proposal
launchBlock
launch a coroutine without exposing the bloc's CoroutineScope, it's internal to allow for JobConfig default values via extension functions
Functions
Link copied to clipboard
fun <State, Action, Proposal> ThunkContextNoAction<State, Action, Proposal>.launch(block: SuspendBlock): Cancel
fun <State, Action, Proposal> ThunkContextNoAction<State, Action, Proposal>.launch(jobConfig: JobConfig, block: SuspendBlock): Cancel
Extension function for ThunkContextNoAction to launch a coroutine and run a suspend function without exposing the bloc's CoroutineScope.