blocState
fun <State : Any, Proposal : Any> blocState(block: BlocStateBuilder<State, Proposal>.() -> Unit): BlocState<State, Proposal>
Creates a BlocState instance using a BlocStateBuilder
blocState<State, Proposal> {
initialState = SomeState
accept { proposal, state ->
// map Proposal to State
}
}
Content copied to clipboard
Creates a BlocState instance using a SimpleBlocStateBuilder (Proposal == State -> no accept function needed):
blocState<State>(SomeState)
Content copied to clipboard