package Ġc afe . ad riel . voy ager . core . model Ċ Ċ import Ġandroidx . compose . runtime . Composable Ċ import Ġandroidx . compose . runtime . Dis allow Composable Calls Ċ import Ġandroidx . compose . runtime . remember Ċ import Ġc afe . ad riel . voy ager . core . screen . Screen Ċ import Ġkotlinx . coroutines . Coroutine Name Ċ import Ġkotlinx . coroutines . Coroutine Scope Ċ import Ġkotlinx . coroutines . Main Scope Ċ import Ġkotlinx . coroutines . cancel Ċ import Ġkotlinx . coroutines . flow . Mutable State Flow Ċ import Ġkotlinx . coroutines . flow . State Flow Ċ import Ġkotlinx . coroutines . flow . as State Flow Ċ import Ġkotlinx . coroutines . plus Ċ Ċ public Ġval ĠScreen Model . coroutine Scope : ĠCor outine Scope ĊĠĠĠ Ġget () Ġ= ĠScreen Model Store . get Or Put Dependency ( ĊĠĠĠĠĠĠĠ Ġscreen Model Ġ= Ġthis , ĊĠĠĠĠĠĠĠ Ġname Ġ= Ġ" Screen Model Coroutine Scope ", ĊĠĠĠĠĠĠĠ Ġfactory Ġ= Ġ{ Ġkey Ġ-> ĠMain Scope () Ġ+ ĠCor outine Name ( key ) Ġ}, ĊĠĠĠĠĠĠĠ Ġon Dispose Ġ= Ġ{ Ġscope Ġ-> Ġscope . cancel () Ġ} ĊĠĠĠ Ġ) Ċ Ċ @ Composable Ċ public Ġinline Ġfun Ġ< re ified ĠT Ġ: ĠScreen Model > ĠScreen . remember Screen Model ( ĊĠĠĠ Ġtag : ĠString ? Ġ= Ġnull , ĊĠĠĠ Ġfactory : Ġ@ Dis allow Composable Calls Ġ() Ġ-> ĠT Ċ ): ĠT Ġ= Ġremember ( Screen Model Store . getKey < T >( this , Ġtag )) Ġ{ ĊĠĠĠ ĠScreen Model Store . get Or Put ( this , Ġtag , Ġfactory ) Ċ } Ċ Ċ public Ġinterface ĠScreen Model Ġ{ ĊĊĠĠĠ Ġpublic Ġfun Ġon Dispose () Ġ{} Ċ } Ċ Ċ public Ġabstract Ġclass ĠState Screen Model < S >( initialState : ĠS ) Ġ: ĠScreen Model Ġ{ ĊĊĠĠĠ Ġprotected Ġval Ġmutable State : ĠMutable State Flow < S > Ġ= ĠMutable State Flow ( initialState ) ĊĠĠĠ Ġpublic Ġval Ġstate : ĠState Flow < S > Ġ= Ġmutable State . as State Flow () Ċ } Ċ