DocsPageViewModel

class DocsPageViewModel(@Assisted pageId: String, bundleLoader: DocBundleLoader, translationService: DocTranslationService, dispatchers: CoroutineDispatchers) : ViewModel(source)

Loads one docs page for a locale: a bundled Crowdin file first, then English, then runtime translation.

Constructors

Link copied to clipboard
constructor(@Assisted pageId: String, bundleLoader: DocBundleLoader, translationService: DocTranslationService, dispatchers: CoroutineDispatchers)

Types

Link copied to clipboard
@AssistedFactory
fun interface Factory : ManualViewModelAssistedFactory

Properties

Link copied to clipboard
val uiState: StateFlow<DocsPageUiState>

Functions

Link copied to clipboard
expect open fun addCloseable(closeable: AutoCloseable)
expect fun addCloseable(key: String, closeable: AutoCloseable)
Link copied to clipboard
expect fun <T : AutoCloseable> getCloseable(key: String): T?
Link copied to clipboard
fun load(locale: String)

Loads the page for locale, superseding any load still running for another locale.