package Ġcom . lev im ore ira . team men ager app . business . view model Ċ Ċ import Ġandroid . arch . lifecycle . LiveData Ċ import Ġandroid . arch . lifecycle . LiveData Reactive Streams Ċ import Ġandroid . arch . lifecycle . ViewModel Ċ import Ġcom . lev im ore ira . team men ager app . application . entities . Business Ċ import Ġcom . lev im ore ira . team men ager app . business . data . Business Repository Ċ import Ġcom . lev im ore ira . team men ager app . organization . data . Organization Repository Ċ import Ġio . reactivex . android . schedul ers . Android Schedulers Ċ import Ġio . reactivex . schedul ers . Schedulers Ċ import Ġjavax . inject . Inject Ċ Ċ class ĠBusiness Item ViewModel Ġ@ Inject Ġconstructor ( var Ġbusiness Repository : ĠBusiness Repository ) Ġ: ĠViewModel () Ġ{ ĊĠĠĠ Ġfun Ġcreate Business ( business : ĠBusiness ): ĠLive Data < Long > Ġ{ ĊĠĠĠĠĠĠĠ Ġval Ġresult Ġ= Ġbusiness Repository ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġ. insert Business ( business ) ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġ. subscribe On ( Schedulers . io ()) ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġ. observe On ( Android Schedulers . main Thread ()) ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġ. to Flow able () ĊĊĠĠĠĠĠĠĠ Ġreturn ĠLive Data Reactive Streams . from Publisher ( result ) ĊĠĠĠ Ġ} Ċ }