vector-im/element-x-ios/issues/53 - Various tweaks following code review

This commit is contained in:
Stefan Ceriu
2022-05-25 16:51:48 +03:00
committed by Stefan Ceriu
parent 73f507045b
commit 8fec97217f
23 changed files with 172 additions and 126 deletions
@@ -99,14 +99,15 @@ class StateStoreViewModel<State: BindableState, ViewAction> {
self.context = Context(initialViewState: initialViewState)
self.context.viewActions.sink { [weak self] action in
guard let self = self else { return }
self.process(viewAction: action)
Task { await self.process(viewAction: action) }
}
.store(in: &cancellables)
}
/// Override to handles incoming `ViewAction`s from the `ViewModel`.
/// - Parameter viewAction: The `ViewAction` to be processed in `ViewModel` implementation.
func process(viewAction: ViewAction) {
func process(viewAction: ViewAction) async {
// Default implementation, -no-op
}
}