package Ġcom . v ish nus 1 2 2 4 . simp ly rss . feed library . di Ċ Ċ import Ġarrow . effects . For Single K Ċ import Ġarrow . effects . Single K Ċ import Ġarrow . effects . single k . mon ad De fer . mon ad De fer Ċ import Ġarrow . effects . type classes . Monad De fer Ċ import Ġcom . v ish nus 1 2 2 4 . simp ly rss . feed library . repository . Feed Repository Ċ import Ġcom . v ish nus 1 2 2 4 . simp ly rss . feed library . use case . Save Feed UseCase Ċ import Ġjava . lang . IllegalStateException Ċ Ċ internal Ġval Ġadd New Feed Component : ĠAdd New Feed With Single K ĊĠĠĠ Ġget () Ġ= ĠAdd New Feed Module With Single K . getComponent () Ċ Ċ interface ĠAdd New Feed Component < F > Ġ{ ĊĠĠĠ Ġval Ġsave Feed UseCase : ĠSave Feed UseCase < F > Ċ } Ċ Ċ internal Ġobject ĠAdd New Feed With Single K Ġ: ĠAdd New Feed Component < For Single K > Ġ{ ĊĠĠĠ Ġoverride Ġval Ġsave Feed UseCase : ĠSave Feed UseCase < For Single K > ĊĠĠĠĠĠĠĠ Ġget () Ġ= Ġsave Feed UseCase With Single K ( Feed Library Module . getComponent (). feed Repository ) Ċ } Ċ Ċ internal Ġfun Ġsave Feed UseCase With Single K ( ĊĠĠĠ Ġfeed Repository : ĠFeed Repository Ċ ): ĠSave Feed UseCase < For Single K > Ġ= Ġobject Ġ: ĠSave Feed UseCase < For Single K >, ĠMonad De fer < For Single K > Ġby ĠSingle K . mon ad De fer () Ġ{ ĊĠĠĠ Ġoverride Ġval Ġfeed Repository : ĠFeed Repository ĊĠĠĠĠĠĠĠ Ġget () Ġ= Ġfeed Repository Ċ } Ċ Ċ internal Ġclass ĠAdd New Feed Module With Single K Ġ{ ĊĠĠĠ Ġcompanion Ġobject Ġ{ ĊĠĠĠĠĠĠĠ Ġ@ Jvm Static ĊĠĠĠĠĠĠĠ Ġprivate Ġvar Ġcomponent : ĠAdd New Feed With Single K ? Ġ= Ġnull ĊĊĠĠĠĠĠĠĠ Ġ@ Jvm Static ĊĠĠĠĠĠĠĠ Ġfun Ġinit ( component : ĠAdd New Feed With Single K ) Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠ Ġthis . component Ġ= Ġcomponent ĊĠĠĠĠĠĠĠ Ġ} ĊĊĠĠĠĠĠĠĠ Ġinternal Ġfun Ġget Component (): ĠAdd New Feed With Single K Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠ Ġif Ġ( component Ġ!= Ġnull ) Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġreturn Ġcomponent !! ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ} Ġelse Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġthrow ĠIllegalStateException (" View Ġsaved Ġfeeds Ġmodule Ġnot Ġinitialized , Ġcall Ġinit () Ġbefore Ġuse ") ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ} ĊĠĠĠĠĠĠĠ Ġ} ĊĠĠĠ Ġ} Ċ }