package Ġcom . example . android . polit ical prepared ness . data . repository . impl Ċ Ċ import Ġcom . example . android . polit ical prepared ness . data . repository . E lection Repository Ċ import Ġcom . example . android . polit ical prepared ness . data . source . local . E lection Local DataSource Ċ import Ġcom . example . android . polit ical prepared ness . data . source . remote . E lection Remote DataSource Ċ import Ġcom . example . android . polit ical prepared ness . models . E lection Ċ import Ġkotlinx . coroutines . flow . Flow Ċ import Ġjavax . inject . Inject Ċ import Ġjavax . inject . Singleton Ċ Ċ @ Singleton Ċ class ĠDefault E lection Repository Ġ@ Inject Ġconstructor ( ĊĠĠĠ Ġprivate Ġval Ġelection Remote DataSource : ĠE lection Remote DataSource , ĊĠĠĠ Ġprivate Ġval Ġelection Local DataSource : ĠE lection Local DataSource Ċ ) Ġ: ĠE lection Repository Ġ{ ĊĊĠĠĠ Ġoverride Ġsuspend Ġfun Ġget Up coming E lection s (): ĠList < E lection > Ġ{ ĊĠĠĠĠĠĠĠ Ġreturn Ġelection Remote DataSource . get Up coming E lection s () ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġoverride Ġsuspend Ġfun Ġobserve Saved E lection s (): ĠFlow < List < E lection >> Ġ{ ĊĠĠĠĠĠĠĠ Ġreturn Ġelection Local DataSource . observe E lection s () ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġoverride Ġsuspend Ġfun Ġtoggle Following ( election : ĠE lection ) Ġ{ ĊĠĠĠĠĠĠĠ Ġelection Local DataSource . toggle Following ( election ) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġoverride Ġfun Ġobserve Is Following ( election Id : ĠInt ): ĠFlow < Boolean > Ġ{ ĊĠĠĠĠĠĠĠ Ġreturn Ġelection Local DataSource . observe Is Following ( election Id ) ĊĠĠĠ Ġ} Ċ Ċ }