package Ġid . kotlin . student . core . domain Ċ Ċ import Ġid . kotlin . student . core . executor . Post Execution Thread Ċ import Ġid . kotlin . student . core . executor . Thread Executor Ċ import Ġio . reactivex . Single Ċ import Ġio . reactivex . dis pos ables . Composite Disposable Ċ import Ġio . reactivex . schedul ers . Schedulers Ċ Ċ abstract Ġclass ĠUse case < T , Ġin ĠParams >( ĊĠĠĠ Ġprivate Ġval Ġthread Executor : ĠThread Executor , ĊĠĠĠ Ġprivate Ġval Ġpost Execution Thread : ĠPost Execution Thread ) Ġ{ ĊĊĠ Ġprivate Ġval Ġdis pos ables : ĠComposite Disposable Ġ= ĠComposite Disposable () ĊĊĠ Ġprotected Ġabstract Ġfun Ġbuild Use case Observable ( params : ĠParams ?): ĠSingle < T > ĊĊĠ Ġfun Ġexecute ( single Observer : ĠDefault Observer < T >, Ġparams : ĠParams ?) Ġ{ ĊĠĠĠ Ġval Ġsingle : ĠSingle < T > Ġ= Ġbuild Use case Observable ( params ) ĊĠĠĠĠĠĠĠ Ġ. subscribe On ( Schedulers . from ( thread Executor )) ĊĠĠĠĠĠĠĠ Ġ. observe On ( post Execution Thread . scheduler ) ĊĠĠĠ Ġdis pos ables . add ( single . subscribe With ( single Observer )) ĊĠ Ġ} ĊĊĠ Ġfun Ġdispose () Ġ{ ĊĠĠĠ Ġdis pos ables . clear () ĊĠ Ġ} Ċ }