package Ġcom . mult ith read . coco on . domain . use case Ċ Ċ import Ġcom . mult ith read . coco on . base . Repository Strategy Ċ import Ġcom . mult ith read . coco on . base . Result Response Ċ import Ġcom . mult ith read . coco on . base . Top St ories Param Ċ import Ġcom . mult ith read . coco on . base . domain . General UseCase Ċ import Ġcom . mult ith read . coco on . base . repository . Strategy Flow Repository Ċ import Ġcom . mult ith read . coco on . domain . model . Top Story Domain Entity Ċ import Ġcom . mult ith read . coco on . error . Error Container Ċ import Ġkotlinx . coroutines . Experimental Cor outines Api Ċ import Ġkotlinx . coroutines . flow . Flow Ċ import Ġjavax . inject . Inject Ċ Ċ class ĠTop St ories UseCase Ġ@ Inject Ġconstructor ( ĊĠĠĠ Ġprivate Ġval Ġtop St ories Repository : ĠStrategy Flow Repository < Top Story Domain Entity , ĠTop St ories Param >, ĊĠĠĠ Ġerror Container : ĠError Container Ċ ) Ġ: ĠGeneral UseCase < Top St ories Param , ĠTop Story Domain Entity >( error Container ) Ġ{ ĊĠĠĠ Ġ@ Experimental Cor outines Api ĊĠĠĠ Ġoverride Ġsuspend Ġfun Ġbuild Flow ( ĊĠĠĠĠĠĠĠ Ġparam : ĠTop St ories Param , ĊĠĠĠĠĠĠĠ Ġstrategy : ĠRepository Strategy ĊĠĠĠ Ġ): ĠFlow < Result Response < Top Story Domain Entity >> Ġ= Ġwhen Ġ( param ) Ġ{ ĊĠĠĠĠĠĠĠ Ġis ĠTop St ories Param . AddTo F avorites Ġ-> Ġtop St ories Repository . getResult ( ĊĠĠĠĠĠĠĠĠĠĠĠ Ġparam , ĊĠĠĠĠĠĠĠĠĠĠĠ ĠRepository Strategy . Local ĊĠĠĠĠĠĠĠ Ġ) ĊĠĠĠĠĠĠĠ Ġis ĠTop St ories Param . Remove From F avorites Ġ-> Ġtop St ories Repository . getResult ( ĊĠĠĠĠĠĠĠĠĠĠĠ Ġparam , ĊĠĠĠĠĠĠĠĠĠĠĠ ĠRepository Strategy . Local ĊĠĠĠĠĠĠĠ Ġ) ĊĠĠĠĠĠĠĠ Ġis ĠTop St ories Param . Get Top St ories Ġ-> Ġtop St ories Repository . getResult ( ĊĠĠĠĠĠĠĠĠĠĠĠ Ġparam , ĊĠĠĠĠĠĠĠĠĠĠĠ ĠRepository Strategy . Offline First ĊĠĠĠĠĠĠĠ Ġ) ĊĠĠĠĠĠĠĠ Ġis ĠTop St ories Param . Get Favorite Top Story Ġ-> Ġtop St ories Repository . getResult ( ĊĠĠĠĠĠĠĠĠĠĠĠ Ġparam , ĊĠĠĠĠĠĠĠĠĠĠĠ ĠRepository Strategy . Local ĊĠĠĠĠĠĠĠ Ġ) ĊĠĠĠ Ġ} ĊĊ Ċ }