package Ġcom . example . movie app . ViewModel Ċ Ċ import Ġandroidx . lifecycle . LiveData Ċ import Ġandroidx . lifecycle . Mutable LiveData Ċ import Ġandroidx . lifecycle . ViewModel Ċ import Ġandroidx . lifecycle . viewModel Scope Ċ import Ġcom . example . movie app . data . datasource . Resource Ċ import Ġcom . example . movie app . model . Movies Response Ċ import Ġcom . example . movie app . data . repository . Movie Repository Ċ import Ġcom . example . movie app . model . Movie Gen res Ċ import Ġdagger . h ilt . android . lifecycle . H ilt ViewModel Ċ import Ġkotlinx . coroutines . launch Ċ import Ġjavax . inject . Inject Ċ Ċ @ H ilt ViewModel Ċ class ĠSingle Movie ViewModel Ġ@ Inject Ġconstructor ( private Ġval Ġrepository : ĠMovie Repository ) Ġ: ĠViewModel () Ġ{ ĊĊĠĠĠ Ġval Ġ_ my Movie Genre Response : ĠMutable LiveData < Resource < Movie Gen res >> Ġ= ĠMutable LiveData () ĊĊĊĠĠĠ Ġval Ġmovie Genre Response : ĠLive Data < Resource < Movie Gen res >> ĊĠĠĠĠĠĠĠ Ġget () Ġ= Ġ_ my Movie Genre Response ĊĊĠĠĠ Ġfun Ġget Movies Genre () Ġ{ ĊĠĠĠĠĠĠĠ ĠviewModel Scope . launch Ġ{ ĊĊĠĠĠĠĠĠĠĠĠĠĠ Ġ_ my Movie Genre Response . value Ġ= ĠResource . Loading ĊĊĠĠĠĠĠĠĠĠĠĠĠ Ġ_ my Movie Genre Response . value Ġ= Ġrepository . get Movie Genre (" en - US ") ĊĠĠĠĠĠĠĠ Ġ} ĊĠĠĠ Ġ} Ċ Ċ }