package Ġcom . cost ular . mar vel hero es . data . repository . datasource Ċ Ċ import Ġcom . cost ular . mar vel hero es . data . database . Mar vel Hero es Database Ċ import Ġcom . cost ular . mar vel hero es . domain . model . Mar vel Hero Entity Ċ import Ġio . reactivex . Flow able Ċ import Ġio . reactivex . Observable Ċ import Ġio . reactivex . schedul ers . Schedulers Ċ Ċ class ĠLocal Mar vel Hero es DataSource ( val Ġmar vel Hero Database : ĠMar vel Hero es Database ) Ġ: ĠMar vel Hero es DataSource Ġ{ ĊĊĠĠĠ Ġoverride Ġfun Ġget Mar vel Hero es List (): ĠFlow able < List < Mar vel Hero Entity >> Ġ= Ġmar vel Hero Database . get Mar vel Hero es Dao (). getAll Mar vel Hero es (). to Flow able () ĊĊĠĠĠ Ġfun Ġsave Mar vel Hero es ( mar vel Hero es : ĠList < Mar vel Hero Entity > ){ ĊĠĠĠĠĠĠĠ ĠObservable . from Callable Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠ Ġmar vel Hero Database . get Mar vel Hero es Dao (). remove And Insert Mar vel Hero es ( mar vel Hero es ) ĊĠĠĠĠĠĠĠ Ġ}. subscribe On ( Schedulers . io ()) ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġ. subscribe () ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġfun Ġset Mar vel Hero F avour ite ( mar vel Hero : ĠMar vel Hero Entity ) Ġ{ ĊĠĠĠĠĠĠĠ ĠObservable . from Callable Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠ Ġmar vel Hero Database . get Mar vel Hero es Dao (). update Mar vel Hero ( mar vel Hero ) ĊĠĠĠĠĠĠĠ Ġ}. subscribe On ( Schedulers . io ()) ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġ. subscribe () ĊĠĠĠ Ġ} Ċ } Ċ