HomeViewModel

class HomeViewModel @Inject constructor(homeRepository: HomeRepository) : ViewModel

ViewModel for the home screen, managing the list of Jetpack libraries.

This ViewModel follows the standard state management pattern using UiState to wrap HomeScreenData. It observes the repository's Flow and automatically updates the UI state. The deleteJetpack method uses updateWith for async operations with automatic error handling.

Parameters

homeRepository

Repository providing Jetpack data and operations.

See also

Immutable data class representing the screen state

State wrapper with loading and error handling

Extension function for async operations that don't return new data

Data layer interface for home screen operations

Constructors

Link copied to clipboard
@Inject
constructor(homeRepository: HomeRepository)

Properties

Link copied to clipboard

Functions

Link copied to clipboard
open fun addCloseable(closeable: AutoCloseable)
fun addCloseable(key: String, closeable: AutoCloseable)
Link copied to clipboard
fun deleteJetpack(jetpack: Jetpack)
Link copied to clipboard