package Ġcash . z . ecc . android . sdk . ext . android Ċ Ċ import Ġkotlinx . coroutines .* Ċ import Ġkotlinx . coroutines . channels . Con fl ated Broadcast Channel Ċ import Ġkotlinx . coroutines . flow . as Flow Ċ import Ġkotlinx . coroutines . flow . flow On Ċ import Ġkotlinx . coroutines . flow . onStart Ċ Ċ /* ĠAdapt ed Ġfrom ĠComp utable LiveData Ġ*/ Ċ abstract Ġclass ĠComp utable Flow < T >( dispatcher : ĠCor outine Dispatcher Ġ= ĠDispatch ers . IO ) Ġ{ ĊĠĠĠ Ġprivate Ġval Ġcomputation Scope : ĠCor outine Scope Ġ= ĠCor outine Scope ( dispatcher Ġ+ ĠSuper visor Job ()) ĊĠĠĠ Ġprivate Ġval Ġcomputation Channel : ĠCon fl ated Broadcast Channel < T > Ġ= ĠCon fl ated Broadcast Channel () ĊĠĠĠ Ġinternal Ġval Ġflow Ġ= Ġcomputation Channel . as Flow (). flow On ( dispatcher ). onStart Ġ{ ĊĠĠĠĠĠĠĠ Ġinvalidate () ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġ/** ĊĠĠĠĠ Ġ* ĠInvalid ates Ġthe Ġflow . ĊĠĠĠĠ Ġ* ĠThis Ġwill Ġtrigger Ġa Ġcall Ġto Ġ[. compute ]. ĊĠĠĠĠ Ġ*/ ĊĠĠĠ Ġfun Ġinvalidate () Ġ{ ĊĠĠĠĠĠĠĠ Ġcomputation Scope . launch Ġ{ Ġcomputation Channel . send ( compute ()) Ġ} ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġfun Ġcancel () Ġ{ ĊĠĠĠĠĠĠĠ Ġcomputation Scope . cancel () ĊĠĠĠĠĠĠĠ Ġcomputation Channel . cancel () ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġprotected Ġabstract Ġfun Ġcompute (): ĠT Ċ } Ċ