-
public final class SubscribeDslKt
-
-
Method Summary
Modifier and Type Method Description final static <S extends MVIState, I extends MVIIntent, A extends MVIAction> State<S>subscribe(Store<S, I, A> $self, Lifecycle.State lifecycleState, SuspendFunction2<CoroutineScope, A, Unit> consume)A function to subscribe to the store that follows the system lifecycle. -
-
Method Detail
-
subscribe
@Composable() final static <S extends MVIState, I extends MVIIntent, A extends MVIAction> State<S> subscribe(Store<S, I, A> $self, Lifecycle.State lifecycleState, SuspendFunction2<CoroutineScope, A, Unit> consume)
A function to subscribe to the store that follows the system lifecycle. This function will assign the store a new subscriber when invoked, then populate the returned State with new states. Provided consume parameter will be used to consume actions that come from the store. consume can be null (by default) if you have your actions disabled or don't want to receive them.
- Parameters:
lifecycleState- the minimum lifecycle state that should be reached in order to subscribe to the store, upon leaving that state, the function will unsubscribe.consume- a lambda to consume actions with.
-
-
-
-