package Ġcom . nec atis o zer . near by rest aurants . domain . use case Ċ Ċ import Ġcom . nec atis o zer . near by rest aurants . domain . model . Result Ċ import Ġkotlinx . coroutines . Coroutine Dispatcher Ċ import Ġkotlinx . coroutines . flow . Flow Ċ import Ġkotlinx . coroutines . flow . catch Ċ import Ġkotlinx . coroutines . flow . flow On Ċ Ċ abstract Ġclass ĠFlow UseCase < in ĠP , ĠR >( private Ġval Ġcoroutine Dispatcher : ĠCor outine Dispatcher ) Ġ{ ĊĠĠĠ Ġoperator Ġfun Ġinvoke ( parameters : ĠP ): ĠFlow < Result < R >> Ġ= Ġexecute ( parameters ) ĊĠĠĠĠĠĠĠ Ġ. catch Ġ{ Ġe Ġ-> Ġemit ( Result . Error ( Exception ( e ))) Ġ} ĊĠĠĠĠĠĠĠ Ġ. flow On ( coroutine Dispatcher ) ĊĊĠĠĠ Ġprotected Ġabstract Ġfun Ġexecute ( parameters : ĠP ): ĠFlow < Result < R >> Ċ } Ċ