mvrx-rxjava2 / com.airbnb.mvrx / MvRxView / selectSubscribe

selectSubscribe

open fun <S : MvRxState, A> BaseMvRxViewModel<S>.selectSubscribe(prop1: KProperty1<S, A>, deliveryMode: DeliveryMode = RedeliverOnStart, subscriber: (A) -> Unit): Disposable

Subscribes to state changes for only a specific property and calls the subscribe with only that single property.

Parameters

deliveryMode -

If UniqueOnly, when this MvRxView goes from a stopped to start lifecycle a state value will only be emitted if the state changed. This is useful for transient views that should only be shown once (toasts, poptarts), or logging. Most other views should use false, as when a view is destroyed and recreated the previous state is necessary to recreate the view.

Use uniqueOnly to automatically create a UniqueOnly mode with a unique id for this view.

Default: RedeliverOnStart.

open fun <S : MvRxState, A, B> BaseMvRxViewModel<S>.selectSubscribe(prop1: KProperty1<S, A>, prop2: KProperty1<S, B>, deliveryMode: DeliveryMode = RedeliverOnStart, subscriber: (A, B) -> Unit): Disposable

Subscribes to state changes for two properties.

Parameters

deliveryMode -

If UniqueOnly, when this MvRxView goes from a stopped to start lifecycle a state value will only be emitted if the state changed. This is useful for transient views that should only be shown once (toasts, poptarts), or logging. Most other views should use false, as when a view is destroyed and recreated the previous state is necessary to recreate the view.

Use uniqueOnly to automatically create a UniqueOnly mode with a unique id for this view.

Default: RedeliverOnStart.

open fun <S : MvRxState, A, B, C> BaseMvRxViewModel<S>.selectSubscribe(prop1: KProperty1<S, A>, prop2: KProperty1<S, B>, prop3: KProperty1<S, C>, deliveryMode: DeliveryMode = RedeliverOnStart, subscriber: (A, B, C) -> Unit): Disposable

Subscribes to state changes for three properties.

Parameters

deliveryMode -

If UniqueOnly, when this MvRxView goes from a stopped to start lifecycle a state value will only be emitted if the state changed. This is useful for transient views that should only be shown once (toasts, poptarts), or logging. Most other views should use false, as when a view is destroyed and recreated the previous state is necessary to recreate the view.

Use uniqueOnly to automatically create a UniqueOnly mode with a unique id for this view.

Default: RedeliverOnStart.

open fun <S : MvRxState, A, B, C, D> BaseMvRxViewModel<S>.selectSubscribe(prop1: KProperty1<S, A>, prop2: KProperty1<S, B>, prop3: KProperty1<S, C>, prop4: KProperty1<S, D>, deliveryMode: DeliveryMode = RedeliverOnStart, subscriber: (A, B, C, D) -> Unit): Disposable

Subscribes to state changes for four properties.

Parameters

deliveryMode -

If UniqueOnly, when this MvRxView goes from a stopped to start lifecycle a state value will only be emitted if the state changed. This is useful for transient views that should only be shown once (toasts, poptarts), or logging. Most other views should use false, as when a view is destroyed and recreated the previous state is necessary to recreate the view.

Use uniqueOnly to automatically create a UniqueOnly mode with a unique id for this view.

Default: RedeliverOnStart.

open fun <S : MvRxState, A, B, C, D, E> BaseMvRxViewModel<S>.selectSubscribe(prop1: KProperty1<S, A>, prop2: KProperty1<S, B>, prop3: KProperty1<S, C>, prop4: KProperty1<S, D>, prop5: KProperty1<S, E>, deliveryMode: DeliveryMode = RedeliverOnStart, subscriber: (A, B, C, D, E) -> Unit): Disposable

Subscribes to state changes for five properties.

Parameters

deliveryMode -

If UniqueOnly, when this MvRxView goes from a stopped to start lifecycle a state value will only be emitted if the state changed. This is useful for transient views that should only be shown once (toasts, poptarts), or logging. Most other views should use false, as when a view is destroyed and recreated the previous state is necessary to recreate the view.

Use uniqueOnly to automatically create a UniqueOnly mode with a unique id for this view.

Default: RedeliverOnStart.

open fun <S : MvRxState, A, B, C, D, E, F> BaseMvRxViewModel<S>.selectSubscribe(prop1: KProperty1<S, A>, prop2: KProperty1<S, B>, prop3: KProperty1<S, C>, prop4: KProperty1<S, D>, prop5: KProperty1<S, E>, prop6: KProperty1<S, F>, deliveryMode: DeliveryMode = RedeliverOnStart, subscriber: (A, B, C, D, E, F) -> Unit): Disposable

Subscribes to state changes for six properties.

Parameters

deliveryMode -

If UniqueOnly, when this MvRxView goes from a stopped to start lifecycle a state value will only be emitted if the state changed. This is useful for transient views that should only be shown once (toasts, poptarts), or logging. Most other views should use false, as when a view is destroyed and recreated the previous state is necessary to recreate the view.

Use uniqueOnly to automatically create a UniqueOnly mode with a unique id for this view.

Default: RedeliverOnStart.

open fun <S : MvRxState, A, B, C, D, E, F, G> BaseMvRxViewModel<S>.selectSubscribe(prop1: KProperty1<S, A>, prop2: KProperty1<S, B>, prop3: KProperty1<S, C>, prop4: KProperty1<S, D>, prop5: KProperty1<S, E>, prop6: KProperty1<S, F>, prop7: KProperty1<S, G>, deliveryMode: DeliveryMode = RedeliverOnStart, subscriber: (A, B, C, D, E, F, G) -> Unit): Disposable

Subscribes to state changes for seven properties.

Parameters

deliveryMode -

If UniqueOnly, when this MvRxView goes from a stopped to start lifecycle a state value will only be emitted if the state changed. This is useful for transient views that should only be shown once (toasts, poptarts), or logging. Most other views should use false, as when a view is destroyed and recreated the previous state is necessary to recreate the view.

Use uniqueOnly to automatically create a UniqueOnly mode with a unique id for this view.

Default: RedeliverOnStart.