ExtrasViewModel

class ExtrasViewModel(val dispatchersProvider: DispatchersProvider, val fetchAndGetLorasUseCase: FetchAndGetLorasUseCase, val fetchAndGetHyperNetworksUseCase: FetchAndGetHyperNetworksUseCase, val preferenceManager: PreferenceManager, prompt: String, negativePrompt: String, type: ExtraType, val onError: (Throwable) -> Unit = {}) : BaseMviViewModel<ExtrasState, ExtrasIntent, ExtrasEffect> (source)

Coordinates ExtrasViewModel behavior in the SDAI presentation layer.

Author

Dmitriy Moroz

Constructors

Link copied to clipboard
constructor(dispatchersProvider: DispatchersProvider, fetchAndGetLorasUseCase: FetchAndGetLorasUseCase, fetchAndGetHyperNetworksUseCase: FetchAndGetHyperNetworksUseCase, preferenceManager: PreferenceManager, prompt: String, negativePrompt: String, type: ExtraType, onError: (Throwable) -> Unit = {})

Properties

Link copied to clipboard
private val _effect: Channel<E>
Link copied to clipboard
private val _state: MutableStateFlow<S>
Link copied to clipboard
protected val currentState: ExtrasState
Link copied to clipboard

Exposes the dispatchersProvider value used by the SDAI presentation layer.

Link copied to clipboard
open override val effect: Flow<ExtrasEffect>
Link copied to clipboard
private val effectDispatcher: CoroutineDispatcher
Link copied to clipboard

Exposes the fetchAndGetHyperNetworksUseCase value used by the SDAI presentation layer.

Link copied to clipboard

Exposes the fetchAndGetLorasUseCase value used by the SDAI presentation layer.

Link copied to clipboard
private val onError: (Throwable) -> Unit

Exposes the onError value used by the SDAI presentation layer.

Link copied to clipboard

Exposes the preferenceManager value used by the SDAI presentation layer.

Link copied to clipboard
open override val state: StateFlow<ExtrasState>

Functions

Link copied to clipboard
expect open fun addCloseable(closeable: AutoCloseable)
expect fun addCloseable(key: String, closeable: AutoCloseable)
Link copied to clipboard
internal expect fun clear()
Link copied to clipboard
protected fun emitEffect(effect: ExtrasEffect)
Link copied to clipboard
protected fun emitState(state: ExtrasState)
Link copied to clipboard
expect fun <T : AutoCloseable> getCloseable(key: String): T?
Link copied to clipboard
protected fun launch(dispatcher: CoroutineDispatcher, start: CoroutineStart, block: suspend CoroutineScope.() -> Unit): Job
Link copied to clipboard
private fun loadData(prompt: String, negativePrompt: String, type: ExtraType)
Link copied to clipboard
protected expect open fun onCleared()
Link copied to clipboard
open override fun processIntent(intent: ExtrasIntent)
Link copied to clipboard
protected fun updateState(mutation: (ExtrasState) -> ExtrasState)