title: How to scope a viewModel to a Dialog Composable Function which is not related to NavHost
body: <p>I am using Android compose and view model and I have a ViewModel that is scoped to a single Composable function which is a bottom sheet view, which is inflated using <a href="https://developer.android.com/reference/kotlin/androidx/compose/material/package-summary#bottomsheetscaffold" rel="noreferrer">BottomSheetScaffold</a> and I inject the ViewModel inside the Composable function using <a href="https://developer.android.com/jetpack/compose/libraries#viewmodel" rel="noreferrer">viewModel</a> but I have a problem that <code>viewModel</code> function returns the same viewModel instance created before when I open the bottom sheet again.</p>
  <p>In other words how to scope the ViewModel to a Dialog Composable function which is not related to NavHost and backStack</p>
  <pre><code>
  @Composable
   fun ComposableExample(
  ) {
      val viewModel: ExampleViewModel= viewModel() // createdOnlyOnce and always returns old instance
  }
  </code></pre>