79691592

Date: 2025-07-06 08:30:21
Score: 1
Natty:
Report link

inject your viewmodel using this method for koin

@Composable
inline fun <reified T: ViewModel> koinViewModel(): T {
    val scope = currentKoinScope()
    return viewModel {
        scope.get<T>()
    }
}
Reasons:
  • Low length (0.5):
  • Has code block (-0.5):
  • Low reputation (1):
Posted by: Gamal Ragab