execute

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. In case some variant of MaybeUseCase.execute method has already been called on this instance of MaybeUseCase, previous one is disposed, no matter what current state of internal Maybe is. This behavior can be disabled by passing false to MaybeUseCaseConfig.disposePrevious method.

Return

disposable of internal Maybe. This disposable is disposed automatically. It might be used to dispose use case when you need to dispose it in advance on your own.

Parameters

config

MayberConfig used to process results of internal Maybe.

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. In case some variant of MaybeUseCase.execute method has already been called on this instance of MaybeUseCase, previous one is disposed, no matter what current state of internal Maybe is. This behavior can be disabled by passing false to MaybeUseCaseConfig.disposePrevious method.

Return

disposable of internal Maybe. This disposable is disposed automatically. It might be used to dispose use case when you need to dispose it in advance on your own.

Parameters

args

Arguments used for initial use case initialisation.

config

MaybeUseCaseConfig used to process results of internal Maybe.