@@ -44,6 +44,7 @@ public struct RecommendFeature {
4444 }
4545 var isLoading : Bool = true
4646 var selectedInterest : BaseInterest ?
47+ var shareContent : BaseContentItem ?
4748 }
4849
4950 /// - Action
@@ -55,15 +56,19 @@ public struct RecommendFeature {
5556 case delegate( DelegateAction )
5657
5758 @CasePathable
58- public enum View {
59+ public enum View : BindableAction {
60+ /// - Binding
61+ case binding( BindingAction < State > )
62+
63+ case onAppear
64+ case pagination
65+
5966 case 추가하기_버튼_눌렀을때( BaseContentItem )
6067 case 공유하기_버튼_눌렀을때( BaseContentItem )
6168 case 신고하기_버튼_눌렀을때( BaseContentItem )
6269 case 전체보기_버튼_눌렀을때( ScrollViewProxy )
6370 case 관심사_버튼_눌렀을때( BaseInterest , ScrollViewProxy )
64-
65- case onAppear
66- case pagination
71+ case 링크_공유_완료되었을때
6772 }
6873
6974 public enum InnerAction : Equatable {
@@ -115,6 +120,8 @@ public struct RecommendFeature {
115120
116121 /// - Reducer body
117122 public var body : some ReducerOf < Self > {
123+ BindingReducer ( action: \. view)
124+
118125 Reduce ( self . core)
119126 }
120127}
@@ -123,6 +130,7 @@ private extension RecommendFeature {
123130 /// - View Effect
124131 func handleViewAction( _ action: Action . View , state: inout State ) -> Effect < Action > {
125132 switch action {
133+ case . binding: return . none
126134 case . onAppear:
127135 return . merge(
128136 shared ( . async( . 추천_조회_API) , state: & state) ,
@@ -133,6 +141,7 @@ private extension RecommendFeature {
133141 case let . 추가하기_버튼_눌렀을때( content) :
134142 return . send( . delegate( . 추가하기_버튼_눌렀을때( content) ) )
135143 case let . 공유하기_버튼_눌렀을때( content) :
144+ state. shareContent = content
136145 return . none
137146 case let . 신고하기_버튼_눌렀을때( content) :
138147 return . none
@@ -148,6 +157,9 @@ private extension RecommendFeature {
148157 state. selectedInterest = interest
149158 proxy. scrollTo ( interest. description, anchor: . leading)
150159 return shared ( . async( . 추천_조회_API) , state: & state)
160+ case . 링크_공유_완료되었을때:
161+ state. shareContent = nil
162+ return . none
151163 }
152164 }
153165
0 commit comments