Package-level declarations

Properties

Link copied to clipboard

Get the current provided subscriber lifecycle, or if not found, fall back to the platform-provided lifecycle

Link copied to clipboard

A local composition SubscriberLifecycle instance. May return null if no lifecycle was provided. Can be provided with ProvideSubscriberLifecycle.

Functions

Link copied to clipboard

Provides LocalSubscriberLifecycle with an instance of lifecycle for child content.

Link copied to clipboard

Remember a new subscriber lifecycle instance from delegate to convert it using factory

Link copied to clipboard

Require LocalSubscriberLifecycle to be provided using a composition local.

Link copied to clipboard
@JvmName(name = "subscribeAndConsume")
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.

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.

fun <S : MVIState, I : MVIIntent, A : MVIAction> ImmutableStore<S, I, A>.subscribe(lifecycle: SubscriberLifecycle = DefaultLifecycle, mode: SubscriptionMode = SubscriptionMode.Started): State<S>
@JvmName(name = "subscribeConsume")
fun <S : MVIState, I : MVIIntent, A : MVIAction> ImmutableStore<S, I, A>.subscribe(lifecycle: SubscriberLifecycle = DefaultLifecycle, mode: SubscriptionMode = SubscriptionMode.Started, consume: suspend CoroutineScope.(action: A) -> Unit): State<S>

A function to subscribe to the store that follows the system lifecycle.

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
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.