package Ġcom . gray h erring . dev talk s . ui . edit talk Ċ Ċ import Ġcom . gray h erring . dev talk s . base . events . Event Ċ import Ġcom . gray h erring . dev talk s . base . events . Text ChangeEvent Ċ import Ġcom . gray h erring . dev talk s . base . ui . Base ViewModel Ċ import Ġcom . gray h erring . dev talk s . data . repository . api . Dev Talk ApiClient Ċ import Ġcom . gray h erring . dev talk s . ui . edit talk . events . Edit Init Event Ċ import Ġcom . gray h erring . dev talk s . ui . home . events .* Ċ import Ġjavax . inject . Inject Ċ Ċ class ĠEdit ViewModel Ġ@ Inject Ġconstructor ( private Ġval Ġdev Talk Api : ĠDev Talk ApiClient ) Ġ: ĠBase ViewModel < Edit State >() Ġ{ ĊĠ Ġoverride Ġfun Ġinit State () Ġ= ĠEdit State () ĊĊĊĠ Ġoverride Ġfun Ġhandle Events ( event : ĠEvent ): ĠEdit State Ġ{ ĊĠĠĠ Ġreturn Ġwhen Ġ( event ) Ġ{ ĊĠĠĠĠĠ Ġis ĠEdit Init Event Ġ-> Ġif Ġ( state . talk . id Ġ== Ġnull ) Ġstate . copy ( talk Ġ= Ġevent . talk ) Ġelse Ġstate ĊĠĠĠĠĠ Ġis ĠText ChangeEvent Ġ-> Ġtext Change Reducer ( event , Ġstate ) ĊĠĠĠĠĠ Ġelse Ġ-> Ġstate ĊĠĠĠ Ġ} ĊĠ Ġ} ĊĊĠ Ġprivate Ġfun Ġtext Change Reducer ( text ChangeEvent : ĠText ChangeEvent , Ġstate : ĠEdit State ): ĠEdit State Ġ{ ĊĠĠĠ Ġval ĠnewState Ġ= Ġtext ChangeEvent . value . run Ġ{ ĊĠĠĠĠĠ Ġwhen Ġ( text ChangeEvent ) Ġ{ ĊĠĠĠĠĠĠĠ Ġis ĠPres enter ChangeEvent Ġ-> Ġstate . copy ( talk Ġ= Ġstate . talk . copy ( presenter Ġ= Ġthis )) ĊĠĠĠĠĠĠĠ Ġis ĠTitle ChangeEvent Ġ-> Ġstate . copy ( talk Ġ= Ġstate . talk . copy ( title Ġ= Ġthis )) ĊĠĠĠĠĠĠĠ Ġis ĠPlatform ChangeEvent Ġ-> Ġstate . copy ( talk Ġ= Ġstate . talk . copy ( platform Ġ= Ġthis )) ĊĠĠĠĠĠĠĠ Ġis ĠDescription ChangeEvent Ġ-> Ġstate . copy ( talk Ġ= Ġstate . talk . copy ( description Ġ= Ġthis )) ĊĠĠĠĠĠĠĠ Ġis ĠDate ChangeEvent Ġ-> Ġstate . copy ( talk Ġ= Ġstate . talk . copy ( date Ġ= Ġthis )) ĊĠĠĠĠĠĠĠ Ġis ĠEmail ChangeEvent Ġ-> Ġstate . copy ( talk Ġ= Ġstate . talk . copy ( email Ġ= Ġthis )) ĊĠĠĠĠĠĠĠ Ġis ĠSlide s ChangeEvent Ġ-> Ġstate . copy ( talk Ġ= Ġstate . talk . copy ( slides Ġ= Ġthis )) ĊĠĠĠĠĠĠĠ Ġis ĠStream ChangeEvent Ġ-> Ġstate . copy ( talk Ġ= Ġstate . talk . copy ( stream Ġ= Ġthis )) ĊĠĠĠĠĠĠĠ Ġelse Ġ-> Ġstate ĊĠĠĠĠĠ Ġ} ĊĠĠĠ Ġ} ĊĠĠĠ Ġ// check Ġstate Ġif Ġnew Ġtalk Ġis Ġvalid ĊĠĠĠ Ġreturn ĠnewState ĊĠ Ġ} Ċ Ċ }