@@ -151,7 +151,19 @@ extension RootViewController {
151
151
actionTransform: Root . Action. tokenEditFormAction)
152
152
153
153
case let . info( infoListViewModel, infoViewModel) :
154
- updateWithInfoViewModels ( infoListViewModel, infoViewModel)
154
+ if let infoViewModel = infoViewModel {
155
+ presentViewModels ( infoListViewModel,
156
+ using: InfoListViewController . self,
157
+ actionTransform: Root . Action. infoListEffect,
158
+ and: infoViewModel,
159
+ using: InfoViewController . self,
160
+ actionTransform: Root . Action. infoEffect)
161
+
162
+ } else {
163
+ presentViewModel ( infoListViewModel,
164
+ using: InfoListViewController . self,
165
+ actionTransform: Root . Action. infoListEffect)
166
+ }
155
167
}
156
168
currentViewModel = viewModel
157
169
}
@@ -181,22 +193,6 @@ extension RootViewController {
181
193
)
182
194
presentViewControllers ( [ viewControllerA, viewControllerB] )
183
195
}
184
-
185
- private func updateWithInfoViewModels( _ infoListViewModel: InfoList . ViewModel , _ infoViewModel: Info . ViewModel ? ) {
186
- guard let infoViewModel = infoViewModel else {
187
- presentViewModel ( infoListViewModel,
188
- using: InfoListViewController . self,
189
- actionTransform: Root . Action. infoListEffect)
190
- return
191
- }
192
-
193
- presentViewModels ( infoListViewModel,
194
- using: InfoListViewController . self,
195
- actionTransform: Root . Action. infoListEffect,
196
- and: infoViewModel,
197
- using: InfoViewController . self,
198
- actionTransform: Root . Action. infoEffect)
199
- }
200
196
}
201
197
202
198
private func compose< A, B, C> ( _ transform: @escaping ( A ) -> B , _ handler: @escaping ( B ) -> C ) -> ( A ) -> C {
0 commit comments