package Ġcom . re ky b . j yro . ui . fav our ites Ċ Ċ import Ġandroidx . lifecycle . LiveData Ċ import Ġandroidx . lifecycle . Mutable LiveData Ċ import Ġandroidx . lifecycle . ViewModel Ċ import Ġandroidx . lifecycle . viewModel Scope Ċ import Ġcom . re ky b . j yro . common . Resources Ċ import Ġcom . re ky b . j yro . domain . model . UserDetails Model Ċ import Ġcom . re ky b . j yro . domain . use _ case . local . Clear Fav List UseCase Ċ import Ġcom . re ky b . j yro . domain . use _ case . local . Get Fav List UseCase Ċ import Ġdagger . h ilt . android . lifecycle . H ilt ViewModel Ċ import Ġkotlinx . coroutines . Dispatch ers Ċ import Ġkotlinx . coroutines . flow . collect Ċ import Ġkotlinx . coroutines . launch Ċ import Ġjavax . inject . Inject Ċ Ċ @ H ilt ViewModel Ċ class ĠF avour ites ViewModel Ġ@ Inject Ġconstructor ( ĊĠĠĠ Ġprivate Ġval Ġget Fav List : ĠGet Fav List UseCase , ĊĠĠĠ Ġprivate Ġval Ġclear Fav List : ĠClear Fav List UseCase Ċ ) Ġ: ĠViewModel () Ġ{ ĊĊĠĠĠ Ġprivate Ġval Ġ_ fav our ites State : ĠMutable LiveData < Resources < List < UserDetails Model >>> Ġ= ĠMutable LiveData () ĊĠĠĠ Ġval Ġfavour ites State : ĠLive Data < Resources < List < UserDetails Model >>> Ġ= Ġ_ fav our ites State ĊĊĠĠĠ Ġinit Ġ{ ĊĠĠĠĠĠĠĠ Ġget F avour ites List () ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġprivate Ġfun Ġget F avour ites List () Ġ{ ĊĠĠĠĠĠĠĠ ĠviewModel Scope . launch ( Dispatch ers . IO ) Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠ Ġget Fav List (). collect Ġ{ Ġ_ fav our ites State . post Value ( it ) Ġ} ĊĠĠĠĠĠĠĠ Ġ} ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġfun Ġclear List () Ġ= ĠviewModel Scope . launch ( Dispatch ers . IO ) Ġ{ Ġclear Fav List () Ġ} Ċ } Ċ