package Ġru . z 1 3 . img tags . domain Ċ Ċ import Ġio . reactivex . Observable Ċ import Ġio . reactivex . subjects . Publish Subject Ċ import Ġru . z 1 3 . img tags . domain . Domain Events . App Event Ċ import Ġru . z 1 3 . img tags . domain . Domain Events . Domain Event Ċ import Ġru . z 1 3 . img tags . mvp . utils . Scheduler Provider Ċ Ċ /** Ċ Ġ* Ġ@ author ĠY ura ĠF Ġ( y ura - f . github . io ) Ċ Ġ*/ Ċ class ĠApp Domain Events ( private Ġval Ġscheduler Provider : ĠScheduler Provider ) Ġ: ĠDomain Events Ġ{ ĊĠĠĠ Ġprivate Ġval Ġdomain Event Subject : ĠPublish Subject < Domain Event > Ġ= ĠPublish Subject . create < Domain Event >() ĊĠĠĠ Ġprivate Ġval Ġapp Event Subject : ĠPublish Subject < App Event > Ġ= ĠPublish Subject . create < App Event >() ĊĊĠĠĠ Ġ/** ĊĠĠĠĠ Ġ* ĠDomain ĠEvent ĊĠĠĠĠ Ġ*/ ĊĠĠĠ Ġoverride Ġfun Ġsubscribe On Domain Event (): ĠObservable < Domain Event > Ġ{ ĊĠĠĠĠĠĠĠ Ġreturn Ġdomain Event Subject ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġ. subscribe On ( scheduler Provider . io ()) ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġ. observe On ( scheduler Provider . ui ()) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġoverride Ġfun Ġnotify Domain Event ( domain Event : ĠDomain Event ){ ĊĠĠĠĠĠĠĠ Ġdomain Event Subject . onNext ( domain Event ) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġ/** ĊĠĠĠĠ Ġ* ĠApp ĠEvent ĊĠĠĠĠ Ġ*/ ĊĠĠĠ Ġoverride Ġfun Ġsubscribe On App Event (): ĠObservable < Domain Events . App Event > Ġ{ ĊĠĠĠĠĠĠĠ Ġreturn Ġapp Event Subject ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġ. subscribe On ( scheduler Provider . io ()) ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġ. observe On ( scheduler Provider . ui ()) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġoverride Ġfun Ġnotify App Event ( app Event : ĠDomain Events . App Event ) Ġ{ ĊĠĠĠĠĠĠĠ Ġapp Event Subject . onNext ( app Event ) ĊĠĠĠ Ġ} Ċ }