EditTagViewModel

class EditTagViewModel(dispatchersProvider: DispatchersProvider, prompt: String, negativePrompt: String, tag: String, isNegative: Boolean) : BaseMviViewModel<EditTagState, EditTagIntent, EditTagEffect> (source)

Coordinates EditTagViewModel behavior in the SDAI presentation layer.

Author

Dmitriy Moroz

Parameters

dispatchersProvider

dispatchers provider value consumed by the API.

prompt

positive prompt text for image generation.

negativePrompt

negative prompt text for image generation.

tag

tag value consumed by the API.

isNegative

is negative value consumed by the API.

Constructors

Link copied to clipboard
constructor(dispatchersProvider: DispatchersProvider, prompt: String, negativePrompt: String, tag: String, isNegative: Boolean)

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: EditTagState
Link copied to clipboard
open override val effect: Flow<EditTagEffect>
Link copied to clipboard
private val effectDispatcher: CoroutineDispatcher
Link copied to clipboard
open override val state: StateFlow<EditTagState>

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: EditTagEffect)
Link copied to clipboard
protected fun emitState(state: EditTagState)
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
protected expect open fun onCleared()
Link copied to clipboard
open override fun processIntent(intent: EditTagIntent)
Link copied to clipboard
protected fun updateState(mutation: (EditTagState) -> EditTagState)