I have a program from official android tutorials about creating a database. The program has lots of viewmodels which I guess are instantiated in viewModelFactory. But what does the keyword "initializer" mean? I didn't find any information explaining what it is. Here's a piece of the code
object AppViewModelProvider {
val Factory = viewModelFactory {
initializer {
ItemEditViewModel(
this.createSavedStateHandle(),
inventoryApplication().container.itemsRepository
)
}
...
}
I searched for the relevent information on the android studio site itself, but there were no use.