Skip to content

Commit

Permalink
Review changes
Browse files Browse the repository at this point in the history
Co-authored-by: Natan Vieira <[email protected]>
  • Loading branch information
ghostbear and DevNatan authored Dec 10, 2023
1 parent 2851c0e commit 8c22eaa
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ public inline fun <reified T : ViewModel> Screen.getViewModel(
}

/**
* A function to provide a [dagger.hilt.android.lifecycle.HiltViewModel] managed by voyager ViewModelLifecycleOwner
* A function to provide a [dagger.hilt.android.lifecycle.HiltViewModel] managed by Voyager ViewModelLifecycleOwner
* instead of using Activity ViewModelLifecycleOwner.
* There is compatibility with Activity ViewModelLifecycleOwner too but it must be avoided because your ViewModels
* will be cleared when activity is totally destroyed only.
Expand All @@ -63,9 +63,9 @@ public inline fun <reified T : ViewModel> Screen.getViewModel(
* @return A new instance of [ViewModel] or the existent instance in the [ViewModelStore]
*/
@Composable
public inline fun <reified VM : ViewModel, VMF> Screen.getViewModel(
public inline fun <reified VM : ViewModel, F> Screen.getViewModel(
viewModelProviderFactory: ViewModelProvider.Factory? = null,
noinline viewModelFactory: (VMF) -> VM,
noinline viewModelFactory: (F) -> VM,
) : VM {
val context = LocalContext.current
val lifecycleOwner = LocalLifecycleOwner.current
Expand Down

0 comments on commit 8c22eaa

Please sign in to comment.