package Ġcom . kotlin byte . scoped _ state Ċ Ċ import Ġkotlinx . coroutines . flow . Mutable State Flow Ċ import Ġkotlinx . coroutines . flow . State Flow ĊĊ Ċ interface ĠScoped State Flow < SCOPE > Ġ: ĊĠĠĠ ĠState Flow < Scoped State < Type Matcher < SCOPE , ĠSCO PE >, ĠState Watcher . Base State >> ĊĊ Ċ class ĠMutable Scoped State Flow < SCOPE > Ġprivate Ġconstructor ( ĊĠĠĠ Ġprivate Ġval Ġstate Flow : ĠMutable State Flow < Scoped State < Type Matcher < SCOPE , ĠSCO PE >, ĠState Watcher . Base State >> Ċ ) Ġ: ĊĠĠĠ ĠScoped State Flow < SCOPE >, ĊĠĠĠ ĠMutable State Flow < Scoped State < Type Matcher < SCOPE , ĠSCO PE >, ĠState Watcher . Base State >> Ġby Ġstate Flow Ġ{ ĊĊĠĠĠ Ġsuspend Ġfun Ġemit ( state : ĠState Watcher . Base State ) Ġ{ ĊĠĠĠĠĠĠĠ Ġemit ( Scoped State . from Scope ( state )) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġsuspend Ġfun Ġemit ( ĊĠĠĠĠĠĠĠ Ġscope : ĠType Matcher < SCOPE , ĠSCO PE >, ĊĠĠĠĠĠĠĠ Ġstate : ĠState Watcher . Base State ĊĠĠĠ Ġ) Ġ{ ĊĠĠĠĠĠĠĠ Ġemit ( Scoped State . from Both ( scope , Ġstate )) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġsuspend Ġinline Ġfun Ġ< re ified ĠS Ġ: ĠSCO PE > Ġemit () Ġ{ ĊĠĠĠĠĠĠĠ Ġemit ( Scoped State . from Scope < SCOPE , ĠS >()) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġ@ Jvm Name (" emit Scoped State ") ĊĠĠĠ Ġsuspend Ġinline Ġfun Ġ< re ified ĠS Ġ: ĠSCO PE > Ġemit ( state : ĠState Watcher . Base State ) Ġ{ ĊĠĠĠĠĠĠĠ Ġemit ( Type Matcher . create < SCOPE , ĠS >(), Ġstate ) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġoverride Ġsuspend Ġfun Ġemit ( value : ĠScoped State < Type Matcher < SCOPE , ĠSCO PE >, ĠState Watcher . Base State >) Ġ{ ĊĠĠĠĠĠĠĠ Ġstate Flow . emit ( value ) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġcompanion Ġobject Ġ{ ĊĠĠĠĠĠĠĠ Ġfun Ġ< SCOPE , ĠS Ġ: ĠSCO PE > Ġcreate ( ĊĠĠĠĠĠĠĠĠĠĠĠ Ġscope : ĠClass < S > ĊĠĠĠĠĠĠĠ Ġ) Ġ= ĠMutable Scoped State Flow < SCOPE >( ĊĠĠĠĠĠĠĠĠĠĠĠ ĠMutable State Flow ( Scoped State . Scope ( Type Matcher . create ( scope ))) ĊĠĠĠĠĠĠĠ Ġ) ĊĊĠĠĠĠĠĠĠ Ġfun Ġ< SCOPE , ĠS Ġ: ĠSCO PE > Ġcreate ( ĊĠĠĠĠĠĠĠĠĠĠĠ Ġscope : ĠClass < S >, ĊĠĠĠĠĠĠĠĠĠĠĠ Ġstate : ĠState Watcher . Base State ĊĠĠĠĠĠĠĠ Ġ) Ġ= ĠMutable Scoped State Flow < SCOPE >( ĊĠĠĠĠĠĠĠĠĠĠĠ ĠMutable State Flow ( Scoped State . Both ( Type Matcher . create ( scope ), Ġstate )) ĊĠĠĠĠĠĠĠ Ġ) ĊĊĠĠĠĠĠĠĠ Ġinline Ġfun Ġ< SCOPE , Ġre ified ĠS Ġ: ĠSCO PE > Ġcreate () Ġ= Ġcreate < SCOPE , ĠS >( S :: class . java ) ĊĊĠĠĠĠĠĠĠ Ġinline Ġfun Ġ< SCOPE , Ġre ified ĠS Ġ: ĠSCO PE > Ġcreate ( e : ĠState Watcher . Base State ) Ġ= ĊĠĠĠĠĠĠĠĠĠĠĠ Ġcreate < SCOPE , ĠS >( S :: class . java , Ġe ) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġinline Ġfun Ġ< re ified ĠS Ġ: ĠSCO PE , ĠSTATE : ĠState Watcher . Base State > Ġwith Scope ( no inline Ġblock : ĠMutable Scoped State Flow < SCOPE >. With Scope < SCOPE , ĠSTATE >. () Ġ-> ĠUnit ) Ġ{ ĊĠĠĠĠĠĠĠ ĠWith Scope < SCOPE , ĠSTATE >( Type Matcher . create < SCOPE , ĠS > ()). block () ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġinner Ġclass ĠWith Scope < out ĠS Ġ: ĠSCO PE , ĠSTATE : ĠState Watcher . Base State >( private Ġval Ġtype Matcher : ĠType Matcher < SCOPE , ĠS >) Ġ{ ĊĠĠĠĠĠĠĠ Ġsuspend Ġfun Ġemit ( ĊĠĠĠĠĠĠĠĠĠĠĠ Ġstate : ĠSTATE ĊĠĠĠĠĠĠĠ Ġ) Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠ Ġemit ( type Matcher , Ġstate ) ĊĠĠĠĠĠĠĠ Ġ} ĊĠĠĠ Ġ} Ċ }