title: How to pass parameter to viewmodel constructor using HiltViewModel library with jetpack compose
body: <p>How to pass parameter to viewmodel constructor using HiltViewModel library with jetpack compose
  My code:</p>
  <pre><code>@HiltViewModel
  class GetPurchaseViewModel @Inject constructor(val id:Long) : ViewModel() {
      private val service= RestModule
      var state = MutableStateFlow&lt;State&gt;(State.START)
  
      init{
          get(id)
      }
  
      private fun get(id:Long){
          viewModelScope.launch {
              state.value = State.LOADING
              try {
                  val users = withContext(Dispatchers.IO) {
  
                      service.getIntance().getPurchase(id)
                  }
  
                  state.value = State.SUCCESLISTPURCHASE(users)
              } catch (e: Exception) {
                  state.value = State.FAILURE(message = e.localizedMessage!!)
              }
          }
      }
  
  }
  </code></pre>
  <p>my call in my composable function :</p>
  <pre><code>val model:GetPurchaseViewModel=hiltViewModel(idUser)
  </code></pre>