Package-level declarations

Types

Link copied to clipboard
class KodeinViewModelScopedFactory<A : Any>(di: DI, argType: TypeToken<A>, arg: A, tag: String? = null) : ViewModelProvider.Factory

Factory class for creating ViewModel instances using Kodein dependency injection.

Link copied to clipboard
class KodeinViewModelScopedSingleton(di: DI, tag: String? = null) : ViewModelProvider.Factory

Factory class used to create ViewModel instances with Kodein DI container

Functions

Link copied to clipboard
@Composable
inline fun <VM : ViewModel> rememberViewModel(tag: String? = null): ViewModelLazy<VM>

Composable function that remembers a ViewModel instance in a Composable tree using Kodein DI container. It returns ViewModelLazy, a property delegate that lazily accesses the ViewModel instance.

@Composable
inline fun <A : Any, VM : ViewModel> rememberViewModel(tag: String? = null, arg: A): ViewModelLazy<VM>

Creates a ViewModel instance using Kodein dependency injection and remembers it for recomposition. The ViewModel will be scoped to the current scope defined by the ViewModelStoreOwner.