package Ġcom . example . shopping . data . repository Ċ Ċ import Ġandroidx . lifecycle . Mutable LiveData Ċ import Ġcom . example . shopping . data . model . categories Details . Category Datum Ċ import Ġcom . example . shopping . data . network . IR et rofit Api Ċ import Ġjavax . inject . Inject Ċ import Ġjavax . inject . Singleton Ċ Ċ @ Singleton Ċ class ĠCategory Repo Ġ@ Inject Ġconstructor ( private Ġvar Ġapi : ĠI Ret rofit Api ) Ġ{ ĊĠĠĠ Ġprivate Ġvar Ġcategories List : ĠMutable LiveData < List < Category Datum >> Ġ= ĊĠĠĠĠĠĠĠ ĠMutable LiveData < List < Category Datum >>() ĊĠĠĠ Ġvar Ġdatum List : ĠList < Category Datum >? Ġ= Ġnull ĊĊĊĠĠĠ Ġfun Ġget Categories (): ĠMutable LiveData < List < Category Datum >> Ġ{ ĊĠĠĠĠĠĠĠ Ġreturn Ġcategories List ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġsuspend Ġfun Ġget Categories List Repo ( lang : String ) Ġ{ ĊĠĠĠĠĠĠĠ Ġval Ġresponse Ġ= Ġapi . getC ategories ( lang ). data ĊĠĠĠĠĠĠĠ Ġdatum List Ġ= Ġresponse . data ĊĠĠĠĠĠĠĠ Ġcategories List . post Value ( datum List ) ĊĠĠĠ Ġ} Ċ }