subscribe
inline fun <S : MVIState, I : MVIIntent, A : MVIAction> LifecycleOwner.subscribe(store: Store<S, I, A>, noinline consume: suspend (action: A) -> Unit, crossinline render: suspend (state: S) -> Unit, lifecycleState: Lifecycle.State = Lifecycle.State.STARTED): Job
Subscribe to the store lifecycle-aware.
Parameters
consume
called on each new action. Implement action handling here.
render
called each time the state changes. Render state here.
lifecycleState
the minimum lifecycle state the LifecycleOwner must be in to receive updates.
See also
inline fun <S : MVIState, I : MVIIntent, A : MVIAction> LifecycleOwner.subscribe(store: Store<S, I, A>, crossinline render: suspend (state: S) -> Unit, lifecycleState: Lifecycle.State = Lifecycle.State.STARTED): Job
Subscribe to the store lifecycle-aware.
Parameters
render
called each time the state changes. Render state here.
lifecycleState
the minimum lifecycle state the LifecycleOwner must be in to receive updates.
See also
fun <S : MVIState, I : MVIIntent, A : MVIAction, T : LifecycleOwner, StateConsumer<S>, ActionConsumer<A>> T.subscribe(provider: Store<S, I, A>, lifecycleState: Lifecycle.State = Lifecycle.State.STARTED): Job
Subscribe to the store lifecycle-aware.
Parameters
lifecycleState
the minimum lifecycle state the LifecycleOwner must be in to receive updates.
See also
fun <S : MVIState, I : MVIIntent, A : MVIAction, T : LifecycleOwner, StateConsumer<S>> T.subscribe(provider: Store<S, I, A>, lifecycleState: Lifecycle.State = Lifecycle.State.STARTED): Job
Subscribe to the store lifecycle-aware. This function will not collect the store's actions.
Parameters
lifecycleState
the minimum lifecycle state the LifecycleOwner must be in to receive updates.