BaseRxViewModel

abstract class BaseRxViewModel<S : ViewState> : BaseViewModel<S> , DisposablesOwner

Base ViewModel class prepared for providing data to UI through LiveData and obtaining data from Stores (Repositories) by executing RxJava based use cases eg. ObservableUseCase.

Constructors

BaseRxViewModel
Link copied to clipboard
fun BaseRxViewModel()

Functions

clear
Link copied to clipboard
fun clear()
equals
Link copied to clipboard
open operator fun equals(other: Any?): Boolean
execute
Link copied to clipboard
open fun CompletableUseCase<Unit>.execute(config: CompletableUseCaseConfig.Builder.() -> Unit): Disposable
Executes the use case and adds its disposable to shared, automatically disposed, composite disposable.
open fun <T> FlowableUseCase<Unit, T>.execute(config: FlowableUseCaseConfig.Builder<T>.() -> Unit): Disposable
Executes the use case and adds its disposable to shared, automatically disposed, composite disposable.
open fun <T> MaybeUseCase<Unit, T>.execute(config: MaybeUseCaseConfig.Builder<T>.() -> Unit): Disposable
Executes the use case and adds its disposable to shared, automatically disposed, composite disposable.
open fun <T> ObservableUseCase<Unit, T>.execute(config: ObservableUseCaseConfig.Builder<T>.() -> Unit): Disposable
Executes the use case and adds its disposable to shared, automatically disposed, composite disposable.
open fun <T> SingleUseCase<Unit, T>.execute(config: SingleUseCaseConfig.Builder<T>.() -> Unit): Disposable
Executes the use case and adds its disposable to shared, automatically disposed, composite disposable.
open fun <ARGS> CompletableUseCase<ARGS>.execute(args: ARGS, config: CompletableUseCaseConfig.Builder.() -> Unit): Disposable
Executes the use case and adds its disposable to shared, automatically disposed, composite disposable.
open fun <ARGS, T> FlowableUseCase<ARGS, T>.execute(args: ARGS, config: FlowableUseCaseConfig.Builder<T>.() -> Unit): Disposable
Executes the use case and adds its disposable to shared, automatically disposed, composite disposable.
open fun <ARGS, T> MaybeUseCase<ARGS, T>.execute(args: ARGS, config: MaybeUseCaseConfig.Builder<T>.() -> Unit): Disposable
Executes the use case and adds its disposable to shared, automatically disposed, composite disposable.
open fun <ARGS, T> ObservableUseCase<ARGS, T>.execute(args: ARGS, config: ObservableUseCaseConfig.Builder<T>.() -> Unit): Disposable
Executes the use case and adds its disposable to shared, automatically disposed, composite disposable.
open fun <ARGS, T> SingleUseCase<ARGS, T>.execute(args: ARGS, config: SingleUseCaseConfig.Builder<T>.() -> Unit): Disposable
Executes the use case and adds its disposable to shared, automatically disposed, composite disposable.
executeStream
Link copied to clipboard
open fun Completable.executeStream(config: CompletableUseCaseConfig.Builder.() -> Unit): Disposable
Executes the Completable and adds its disposable to shared, automatically disposed, composite disposable.
open fun <T : Any> Flowable<T>.executeStream(config: FlowableUseCaseConfig.Builder<T>.() -> Unit): Disposable
Executes the Flowable and adds its disposable to shared, automatically disposed, composite disposable.
open fun <T : Any> Maybe<T>.executeStream(config: MaybeUseCaseConfig.Builder<T>.() -> Unit): Disposable
Executes the Maybe and adds its disposable to shared, automatically disposed, composite disposable.
open fun <T : Any> Observable<T>.executeStream(config: ObservableUseCaseConfig.Builder<T>.() -> Unit): Disposable
Executes the Observable and adds its disposable to shared, automatically disposed, composite disposable.
open fun <T : Any> Single<T>.executeStream(config: SingleUseCaseConfig.Builder<T>.() -> Unit): Disposable
Executes the Single and adds its disposable to shared, automatically disposed, composite disposable.
getTag
Link copied to clipboard
open fun <T : Any> getTag(p0: String): T
hashCode
Link copied to clipboard
open fun hashCode(): Int
observeEvent
Link copied to clipboard
fun observeEvent(lifecycleOwner: LifecycleOwner, eventClass: KClass<out Event<S>>, observer: (Event<S>) -> Unit)
observeWithoutOwner
Link copied to clipboard
fun <T> LiveData<T>.observeWithoutOwner(callback: (T) -> Unit)
fun <T : Any> DefaultValueLiveData<T>.observeWithoutOwner(callback: (T) -> Unit)
fun <T : Any> DefaultValueMediatorLiveData<T>.observeWithoutOwner(callback: (T) -> Unit)
onStart
Link copied to clipboard
open fun onStart()
sendEvent
Link copied to clipboard
fun sendEvent(event: Event<S>)
setTagIfAbsent
Link copied to clipboard
open fun <T : Any> setTagIfAbsent(p0: String, p1: T): T
toString
Link copied to clipboard
open fun toString(): String

Properties

disposables
Link copied to clipboard
open override val disposables: CompositeDisposable
CompositeDisposable of all recently executed use cases which is cleared when ViewModel is no longer used and will be destroyed.
internalSavedStateHandle
Link copied to clipboard
var internalSavedStateHandle: SavedStateHandle?
requireSavedStateHandle
Link copied to clipboard
val requireSavedStateHandle: SavedStateHandle
viewState
Link copied to clipboard
abstract val viewState: S