mirror of
https://gitlab.opencode.de/bwi/bundesmessenger/clients/bundesmessenger-ios.git
synced 2026-04-16 06:28:27 +02:00
Removed deprecated StateStoreViewModel dispatching and reducing
This commit is contained in:
committed by
Stefan Ceriu
parent
fc2fdc8ae7
commit
1df0be344d
@@ -1,6 +1,6 @@
|
||||
--swiftversion 5.6
|
||||
|
||||
--exclude CommonKit, Config, DesignKit, Riot, RiotNSE, RiotShareExtension, RiotTests, SiriIntents, Tools, Variants, vendor
|
||||
--exclude build, CommonKit, Config, DesignKit, fastlane, Pods, Riot, RiotNSE, RiotShareExtension, RiotTests, SiriIntents, Tools, Variants, vendor
|
||||
|
||||
--disable wrapMultiLineStatementBraces
|
||||
--disable hoistPatternLet
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
import Combine
|
||||
import SwiftUI
|
||||
|
||||
typealias AnalyticsPromptViewModelType = StateStoreViewModel<AnalyticsPromptViewState, Never, AnalyticsPromptViewAction>
|
||||
typealias AnalyticsPromptViewModelType = StateStoreViewModel<AnalyticsPromptViewState, AnalyticsPromptViewAction>
|
||||
|
||||
class AnalyticsPromptViewModel: AnalyticsPromptViewModelType {
|
||||
// MARK: - Properties
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
|
||||
import SwiftUI
|
||||
|
||||
typealias AuthenticationChoosePasswordViewModelType = StateStoreViewModel<AuthenticationChoosePasswordViewState, Never, AuthenticationChoosePasswordViewAction>
|
||||
typealias AuthenticationChoosePasswordViewModelType = StateStoreViewModel<AuthenticationChoosePasswordViewState, AuthenticationChoosePasswordViewAction>
|
||||
|
||||
class AuthenticationChoosePasswordViewModel: AuthenticationChoosePasswordViewModelType, AuthenticationChoosePasswordViewModelProtocol {
|
||||
// MARK: - Properties
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
|
||||
import SwiftUI
|
||||
|
||||
typealias AuthenticationForgotPasswordViewModelType = StateStoreViewModel<AuthenticationForgotPasswordViewState, Never, AuthenticationForgotPasswordViewAction>
|
||||
typealias AuthenticationForgotPasswordViewModelType = StateStoreViewModel<AuthenticationForgotPasswordViewState, AuthenticationForgotPasswordViewAction>
|
||||
|
||||
class AuthenticationForgotPasswordViewModel: AuthenticationForgotPasswordViewModelType, AuthenticationForgotPasswordViewModelProtocol {
|
||||
// MARK: - Properties
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
|
||||
import SwiftUI
|
||||
|
||||
typealias AuthenticationLoginViewModelType = StateStoreViewModel<AuthenticationLoginViewState, Never, AuthenticationLoginViewAction>
|
||||
typealias AuthenticationLoginViewModelType = StateStoreViewModel<AuthenticationLoginViewState, AuthenticationLoginViewAction>
|
||||
|
||||
class AuthenticationLoginViewModel: AuthenticationLoginViewModelType, AuthenticationLoginViewModelProtocol {
|
||||
// MARK: - Properties
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
|
||||
import SwiftUI
|
||||
|
||||
typealias AuthenticationReCaptchaViewModelType = StateStoreViewModel<AuthenticationReCaptchaViewState, Never, AuthenticationReCaptchaViewAction>
|
||||
typealias AuthenticationReCaptchaViewModelType = StateStoreViewModel<AuthenticationReCaptchaViewState, AuthenticationReCaptchaViewAction>
|
||||
|
||||
class AuthenticationReCaptchaViewModel: AuthenticationReCaptchaViewModelType, AuthenticationReCaptchaViewModelProtocol {
|
||||
// MARK: - Properties
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
import Combine
|
||||
import SwiftUI
|
||||
|
||||
typealias AuthenticationRegistrationViewModelType = StateStoreViewModel<AuthenticationRegistrationViewState, Never, AuthenticationRegistrationViewAction>
|
||||
typealias AuthenticationRegistrationViewModelType = StateStoreViewModel<AuthenticationRegistrationViewState, AuthenticationRegistrationViewAction>
|
||||
|
||||
class AuthenticationRegistrationViewModel: AuthenticationRegistrationViewModelType, AuthenticationRegistrationViewModelProtocol {
|
||||
// MARK: - Properties
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
|
||||
import SwiftUI
|
||||
|
||||
typealias AuthenticationServerSelectionViewModelType = StateStoreViewModel<AuthenticationServerSelectionViewState, Never, AuthenticationServerSelectionViewAction>
|
||||
typealias AuthenticationServerSelectionViewModelType = StateStoreViewModel<AuthenticationServerSelectionViewState, AuthenticationServerSelectionViewAction>
|
||||
|
||||
class AuthenticationServerSelectionViewModel: AuthenticationServerSelectionViewModelType, AuthenticationServerSelectionViewModelProtocol {
|
||||
// MARK: - Properties
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
|
||||
import SwiftUI
|
||||
|
||||
typealias AuthenticationSoftLogoutViewModelType = StateStoreViewModel<AuthenticationSoftLogoutViewState, Never, AuthenticationSoftLogoutViewAction>
|
||||
typealias AuthenticationSoftLogoutViewModelType = StateStoreViewModel<AuthenticationSoftLogoutViewState, AuthenticationSoftLogoutViewAction>
|
||||
|
||||
class AuthenticationSoftLogoutViewModel: AuthenticationSoftLogoutViewModelType, AuthenticationSoftLogoutViewModelProtocol {
|
||||
// MARK: - Properties
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
|
||||
import SwiftUI
|
||||
|
||||
typealias AuthenticationTermsViewModelType = StateStoreViewModel<AuthenticationTermsViewState, Never, AuthenticationTermsViewAction>
|
||||
typealias AuthenticationTermsViewModelType = StateStoreViewModel<AuthenticationTermsViewState, AuthenticationTermsViewAction>
|
||||
|
||||
class AuthenticationTermsViewModel: AuthenticationTermsViewModelType, AuthenticationTermsViewModelProtocol {
|
||||
// MARK: - Properties
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
|
||||
import SwiftUI
|
||||
|
||||
typealias AuthenticationVerifyEmailViewModelType = StateStoreViewModel<AuthenticationVerifyEmailViewState, Never, AuthenticationVerifyEmailViewAction>
|
||||
typealias AuthenticationVerifyEmailViewModelType = StateStoreViewModel<AuthenticationVerifyEmailViewState, AuthenticationVerifyEmailViewAction>
|
||||
|
||||
class AuthenticationVerifyEmailViewModel: AuthenticationVerifyEmailViewModelType, AuthenticationVerifyEmailViewModelProtocol {
|
||||
// MARK: - Properties
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
|
||||
import SwiftUI
|
||||
|
||||
typealias AuthenticationVerifyMsisdnViewModelType = StateStoreViewModel<AuthenticationVerifyMsisdnViewState, Never, AuthenticationVerifyMsisdnViewAction>
|
||||
typealias AuthenticationVerifyMsisdnViewModelType = StateStoreViewModel<AuthenticationVerifyMsisdnViewState, AuthenticationVerifyMsisdnViewAction>
|
||||
|
||||
class AuthenticationVerifyMsisdnViewModel: AuthenticationVerifyMsisdnViewModelType, AuthenticationVerifyMsisdnViewModelProtocol {
|
||||
// MARK: - Properties
|
||||
|
||||
@@ -73,7 +73,7 @@ class ViewModelContext<ViewState: BindableState, ViewAction>: ObservableObject {
|
||||
/// a specific portion of state that can be safely bound to.
|
||||
/// If we decide to add more features to our state management (like doing state processing off the main thread)
|
||||
/// we can do it in this centralised place.
|
||||
class StateStoreViewModel<State: BindableState, StateAction, ViewAction> {
|
||||
class StateStoreViewModel<State: BindableState, ViewAction> {
|
||||
typealias Context = ViewModelContext<State, ViewAction>
|
||||
|
||||
// MARK: - Properties
|
||||
@@ -104,34 +104,6 @@ class StateStoreViewModel<State: BindableState, StateAction, ViewAction> {
|
||||
.store(in: &cancellables)
|
||||
}
|
||||
|
||||
/// Send state actions to modify the state within the reducer.
|
||||
/// - Parameter action: The state action to send to the reducer.
|
||||
@available(*, deprecated, message: "Mutate state directly instead")
|
||||
func dispatch(action: StateAction) {
|
||||
Self.reducer(state: &context.viewState, action: action)
|
||||
}
|
||||
|
||||
/// Send state actions from a publisher to modify the state within the reducer.
|
||||
/// - Parameter actionPublisher: The publisher that produces actions to be sent to the reducer
|
||||
@available(*, deprecated, message: "Mutate state directly instead")
|
||||
func dispatch(actionPublisher: AnyPublisher<StateAction, Never>) {
|
||||
actionPublisher.sink { [weak self] action in
|
||||
guard let self = self else { return }
|
||||
Self.reducer(state: &self.context.viewState, action: action)
|
||||
}
|
||||
.store(in: &cancellables)
|
||||
}
|
||||
|
||||
/// Override to handle mutations to the `State`
|
||||
///
|
||||
/// A redux style reducer, all modifications to state happen here.
|
||||
/// - Parameters:
|
||||
/// - state: The `inout` state to be modified,
|
||||
/// - action: The action that defines which state modification should take place.
|
||||
class func reducer(state: inout State, action: StateAction) {
|
||||
// Default implementation, -no-op
|
||||
}
|
||||
|
||||
/// Override to handles incoming `ViewAction`s from the `ViewModel`.
|
||||
/// - Parameter viewAction: The `ViewAction` to be processed in `ViewModel` implementation.
|
||||
func process(viewAction: ViewAction) {
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
|
||||
import SwiftUI
|
||||
|
||||
typealias LiveLocationLabPromotionViewModelType = StateStoreViewModel<LiveLocationLabPromotionViewState, Never, LiveLocationLabPromotionViewAction>
|
||||
typealias LiveLocationLabPromotionViewModelType = StateStoreViewModel<LiveLocationLabPromotionViewState, LiveLocationLabPromotionViewAction>
|
||||
|
||||
class LiveLocationLabPromotionViewModel: LiveLocationLabPromotionViewModelType, LiveLocationLabPromotionViewModelProtocol {
|
||||
// MARK: - Properties
|
||||
|
||||
@@ -18,7 +18,7 @@ import Combine
|
||||
import Mapbox
|
||||
import SwiftUI
|
||||
|
||||
typealias LiveLocationSharingViewerViewModelType = StateStoreViewModel<LiveLocationSharingViewerViewState, Never, LiveLocationSharingViewerViewAction>
|
||||
typealias LiveLocationSharingViewerViewModelType = StateStoreViewModel<LiveLocationSharingViewerViewState, LiveLocationSharingViewerViewAction>
|
||||
|
||||
class LiveLocationSharingViewerViewModel: LiveLocationSharingViewerViewModelType, LiveLocationSharingViewerViewModelProtocol {
|
||||
// MARK: - Properties
|
||||
|
||||
@@ -18,7 +18,7 @@ import Combine
|
||||
import CoreLocation
|
||||
import SwiftUI
|
||||
|
||||
typealias LocationSharingViewModelType = StateStoreViewModel<LocationSharingViewState, Never, LocationSharingViewAction>
|
||||
typealias LocationSharingViewModelType = StateStoreViewModel<LocationSharingViewState, LocationSharingViewAction>
|
||||
|
||||
class LocationSharingViewModel: LocationSharingViewModelType, LocationSharingViewModelProtocol {
|
||||
// MARK: - Properties
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
import CoreLocation
|
||||
import SwiftUI
|
||||
|
||||
typealias StaticLocationViewingViewModelType = StateStoreViewModel<StaticLocationViewingViewState, Never, StaticLocationViewingViewAction>
|
||||
typealias StaticLocationViewingViewModelType = StateStoreViewModel<StaticLocationViewingViewState, StaticLocationViewingViewAction>
|
||||
|
||||
class StaticLocationViewingViewModel: StaticLocationViewingViewModelType, StaticLocationViewingViewModelProtocol {
|
||||
// MARK: - Properties
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
import Combine
|
||||
import SwiftUI
|
||||
|
||||
typealias OnboardingAvatarViewModelType = StateStoreViewModel<OnboardingAvatarViewState, Never, OnboardingAvatarViewAction>
|
||||
typealias OnboardingAvatarViewModelType = StateStoreViewModel<OnboardingAvatarViewState, OnboardingAvatarViewAction>
|
||||
|
||||
class OnboardingAvatarViewModel: OnboardingAvatarViewModelType, OnboardingAvatarViewModelProtocol {
|
||||
// MARK: - Properties
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
|
||||
import SwiftUI
|
||||
|
||||
typealias OnboardingCelebrationViewModelType = StateStoreViewModel<OnboardingCelebrationViewState, Never, OnboardingCelebrationViewAction>
|
||||
typealias OnboardingCelebrationViewModelType = StateStoreViewModel<OnboardingCelebrationViewState, OnboardingCelebrationViewAction>
|
||||
|
||||
class OnboardingCelebrationViewModel: OnboardingCelebrationViewModelType, OnboardingCelebrationViewModelProtocol {
|
||||
// MARK: - Properties
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
|
||||
import SwiftUI
|
||||
|
||||
typealias OnboardingCongratulationsViewModelType = StateStoreViewModel<OnboardingCongratulationsViewState, Never, OnboardingCongratulationsViewAction>
|
||||
typealias OnboardingCongratulationsViewModelType = StateStoreViewModel<OnboardingCongratulationsViewState, OnboardingCongratulationsViewAction>
|
||||
|
||||
class OnboardingCongratulationsViewModel: OnboardingCongratulationsViewModelType, OnboardingCongratulationsViewModelProtocol {
|
||||
// MARK: - Properties
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
import Combine
|
||||
import SwiftUI
|
||||
|
||||
typealias OnboardingDisplayNameViewModelType = StateStoreViewModel<OnboardingDisplayNameViewState, Never, OnboardingDisplayNameViewAction>
|
||||
typealias OnboardingDisplayNameViewModelType = StateStoreViewModel<OnboardingDisplayNameViewState, OnboardingDisplayNameViewAction>
|
||||
|
||||
class OnboardingDisplayNameViewModel: OnboardingDisplayNameViewModelType, OnboardingDisplayNameViewModelProtocol {
|
||||
// MARK: - Properties
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
import Combine
|
||||
import SwiftUI
|
||||
|
||||
typealias OnboardingSplashScreenViewModelType = StateStoreViewModel<OnboardingSplashScreenViewState, Never, OnboardingSplashScreenViewAction>
|
||||
typealias OnboardingSplashScreenViewModelType = StateStoreViewModel<OnboardingSplashScreenViewState, OnboardingSplashScreenViewAction>
|
||||
|
||||
protocol OnboardingSplashScreenViewModelProtocol {
|
||||
var completion: ((OnboardingSplashScreenViewModelResult) -> Void)? { get set }
|
||||
|
||||
@@ -20,10 +20,6 @@ import Foundation
|
||||
|
||||
// MARK: View model
|
||||
|
||||
enum OnboardingUseCaseStateAction {
|
||||
case viewAction(OnboardingUseCaseViewAction)
|
||||
}
|
||||
|
||||
enum OnboardingUseCaseViewModelResult {
|
||||
case personalMessaging
|
||||
case workMessaging
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
|
||||
import SwiftUI
|
||||
|
||||
typealias OnboardingUseCaseViewModelType = StateStoreViewModel<OnboardingUseCaseViewState, OnboardingUseCaseStateAction, OnboardingUseCaseViewAction>
|
||||
typealias OnboardingUseCaseViewModelType = StateStoreViewModel<OnboardingUseCaseViewState, OnboardingUseCaseViewAction>
|
||||
|
||||
class OnboardingUseCaseViewModel: OnboardingUseCaseViewModelType, OnboardingUseCaseViewModelProtocol {
|
||||
// MARK: - Properties
|
||||
@@ -41,8 +41,4 @@ class OnboardingUseCaseViewModel: OnboardingUseCaseViewModelType, OnboardingUseC
|
||||
completion?(result)
|
||||
}
|
||||
}
|
||||
|
||||
override class func reducer(state: inout OnboardingUseCaseViewState, action: OnboardingUseCaseStateAction) {
|
||||
// There is no mutable state to reduce :)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
import Combine
|
||||
import SwiftUI
|
||||
|
||||
typealias AllChatsOnboardingViewModelType = StateStoreViewModel<AllChatsOnboardingViewState, Never, AllChatsOnboardingViewAction>
|
||||
typealias AllChatsOnboardingViewModelType = StateStoreViewModel<AllChatsOnboardingViewState, AllChatsOnboardingViewAction>
|
||||
|
||||
class AllChatsOnboardingViewModel: AllChatsOnboardingViewModelType, AllChatsOnboardingViewModelProtocol {
|
||||
// MARK: - Properties
|
||||
|
||||
@@ -22,7 +22,7 @@ struct PollEditFormViewModelParameters {
|
||||
let pollDetails: EditFormPollDetails
|
||||
}
|
||||
|
||||
typealias PollEditFormViewModelType = StateStoreViewModel<PollEditFormViewState, Never, PollEditFormViewAction>
|
||||
typealias PollEditFormViewModelType = StateStoreViewModel<PollEditFormViewState, PollEditFormViewAction>
|
||||
|
||||
class PollEditFormViewModel: PollEditFormViewModelType, PollEditFormViewModelProtocol {
|
||||
private enum Constants {
|
||||
|
||||
@@ -42,13 +42,6 @@ enum RoomAccessTypeChooserCoordinatorAction {
|
||||
|
||||
// MARK: - View model
|
||||
|
||||
/// Actions to be performed on the `ViewModel` State
|
||||
enum RoomAccessTypeChooserStateAction {
|
||||
case updateAccessItems([RoomAccessTypeChooserAccessItem])
|
||||
case updateShowUpgradeRoomAlert(Bool)
|
||||
case updateWaitingMessage(String?)
|
||||
}
|
||||
|
||||
/// Actions sent by the`ViewModel` to the `Coordinator`.
|
||||
enum RoomAccessTypeChooserViewModelAction {
|
||||
case spaceSelection(String, RoomAccessTypeChooserAccessType)
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
import Combine
|
||||
import SwiftUI
|
||||
|
||||
typealias RoomAccessTypeChooserViewModelType = StateStoreViewModel<RoomAccessTypeChooserViewState, RoomAccessTypeChooserStateAction, RoomAccessTypeChooserViewAction>
|
||||
typealias RoomAccessTypeChooserViewModelType = StateStoreViewModel<RoomAccessTypeChooserViewState, RoomAccessTypeChooserViewAction>
|
||||
|
||||
class RoomAccessTypeChooserViewModel: RoomAccessTypeChooserViewModelType, RoomAccessTypeChooserViewModelProtocol {
|
||||
// MARK: - Properties
|
||||
@@ -47,10 +47,13 @@ class RoomAccessTypeChooserViewModel: RoomAccessTypeChooserViewModelType, RoomAc
|
||||
}
|
||||
|
||||
private func startObservingService() {
|
||||
let accessTypePublisher = roomAccessTypeChooserService.accessItemsSubject
|
||||
.map(RoomAccessTypeChooserStateAction.updateAccessItems)
|
||||
.eraseToAnyPublisher()
|
||||
dispatch(actionPublisher: accessTypePublisher)
|
||||
roomAccessTypeChooserService
|
||||
.accessItemsSubject
|
||||
.sink(receiveValue: { [weak self] accessItems in
|
||||
self?.state.accessItems = accessItems
|
||||
})
|
||||
.store(in: &cancellables)
|
||||
|
||||
roomAccessTypeChooserService
|
||||
.roomUpgradeRequiredSubject
|
||||
.sink { [weak self] isUpgradeRequired in
|
||||
@@ -59,10 +62,13 @@ class RoomAccessTypeChooserViewModel: RoomAccessTypeChooserViewModelType, RoomAc
|
||||
}
|
||||
}
|
||||
.store(in: &cancellables)
|
||||
let waitingMessagePublisher = roomAccessTypeChooserService.waitingMessageSubject
|
||||
.map(RoomAccessTypeChooserStateAction.updateWaitingMessage)
|
||||
.eraseToAnyPublisher()
|
||||
dispatch(actionPublisher: waitingMessagePublisher)
|
||||
|
||||
roomAccessTypeChooserService.waitingMessageSubject
|
||||
.sink(receiveValue: { [weak self] message in
|
||||
self?.state.bindings.waitingMessage = message
|
||||
self?.state.bindings.isLoading = message != nil
|
||||
})
|
||||
.store(in: &cancellables)
|
||||
}
|
||||
|
||||
// MARK: - Public
|
||||
@@ -77,19 +83,7 @@ class RoomAccessTypeChooserViewModel: RoomAccessTypeChooserViewModelType, RoomAc
|
||||
cancel()
|
||||
}
|
||||
}
|
||||
|
||||
override class func reducer(state: inout RoomAccessTypeChooserViewState, action: RoomAccessTypeChooserStateAction) {
|
||||
switch action {
|
||||
case .updateAccessItems(let accessItems):
|
||||
state.accessItems = accessItems
|
||||
case .updateShowUpgradeRoomAlert(let show):
|
||||
state.bindings.showUpgradeRoomAlert = show
|
||||
case .updateWaitingMessage(let message):
|
||||
state.bindings.waitingMessage = message
|
||||
state.bindings.isLoading = message != nil
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
func handleRoomUpgradeResult(_ result: RoomUpgradeCoordinatorResult) {
|
||||
switch result {
|
||||
case .cancel(let roomId):
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
import Combine
|
||||
import SwiftUI
|
||||
|
||||
typealias RoomUpgradeViewModelType = StateStoreViewModel<RoomUpgradeViewState, Never, RoomUpgradeViewAction>
|
||||
typealias RoomUpgradeViewModelType = StateStoreViewModel<RoomUpgradeViewState, RoomUpgradeViewAction>
|
||||
|
||||
class RoomUpgradeViewModel: RoomUpgradeViewModelType, RoomUpgradeViewModelProtocol {
|
||||
// MARK: - Properties
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
import Combine
|
||||
import SwiftUI
|
||||
|
||||
typealias TimelinePollViewModelType = StateStoreViewModel<TimelinePollViewState, Never, TimelinePollViewAction>
|
||||
typealias TimelinePollViewModelType = StateStoreViewModel<TimelinePollViewState, TimelinePollViewAction>
|
||||
|
||||
class TimelinePollViewModel: TimelinePollViewModelType, TimelinePollViewModelProtocol {
|
||||
// MARK: - Properties
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
import Combine
|
||||
import SwiftUI
|
||||
|
||||
typealias UserSuggestionViewModelType = StateStoreViewModel<UserSuggestionViewState, Never, UserSuggestionViewAction>
|
||||
typealias UserSuggestionViewModelType = StateStoreViewModel<UserSuggestionViewState, UserSuggestionViewAction>
|
||||
|
||||
class UserSuggestionViewModel: UserSuggestionViewModelType, UserSuggestionViewModelProtocol {
|
||||
// MARK: - Properties
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
|
||||
import SwiftUI
|
||||
|
||||
typealias ChangePasswordViewModelType = StateStoreViewModel<ChangePasswordViewState, Never, ChangePasswordViewAction>
|
||||
typealias ChangePasswordViewModelType = StateStoreViewModel<ChangePasswordViewState, ChangePasswordViewAction>
|
||||
|
||||
class ChangePasswordViewModel: ChangePasswordViewModelType, ChangePasswordViewModelProtocol {
|
||||
// MARK: - Properties
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
import Combine
|
||||
import SwiftUI
|
||||
|
||||
typealias MatrixItemChooserViewModelType = StateStoreViewModel<MatrixItemChooserViewState, Never, MatrixItemChooserViewAction>
|
||||
typealias MatrixItemChooserViewModelType = StateStoreViewModel<MatrixItemChooserViewState, MatrixItemChooserViewAction>
|
||||
|
||||
class MatrixItemChooserViewModel: MatrixItemChooserViewModelType, MatrixItemChooserViewModelProtocol {
|
||||
// MARK: - Properties
|
||||
|
||||
@@ -1,24 +0,0 @@
|
||||
// File created from SimpleUserProfileExample
|
||||
// $ createScreen.sh Spaces/SpaceCreation/SpaceCreationEmailInvites SpaceCreationEmailInvites
|
||||
//
|
||||
// Copyright 2021 New Vector Ltd
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
//
|
||||
|
||||
import Foundation
|
||||
|
||||
enum SpaceCreationEmailInvitesStateAction {
|
||||
case updateEmailValidity(_ validity: [Bool])
|
||||
case updateLoading(_ loading: Bool)
|
||||
}
|
||||
@@ -19,7 +19,7 @@
|
||||
import Combine
|
||||
import SwiftUI
|
||||
|
||||
typealias SpaceCreationEmailInvitesViewModelType = StateStoreViewModel<SpaceCreationEmailInvitesViewState, SpaceCreationEmailInvitesStateAction, SpaceCreationEmailInvitesViewAction>
|
||||
typealias SpaceCreationEmailInvitesViewModelType = StateStoreViewModel<SpaceCreationEmailInvitesViewState, SpaceCreationEmailInvitesViewAction>
|
||||
|
||||
class SpaceCreationEmailInvitesViewModel: SpaceCreationEmailInvitesViewModelType, SpaceCreationEmailInvitesViewModelProtocol {
|
||||
// MARK: - Properties
|
||||
@@ -40,12 +40,14 @@ class SpaceCreationEmailInvitesViewModel: SpaceCreationEmailInvitesViewModelType
|
||||
self.service = service
|
||||
super.init(initialViewState: SpaceCreationEmailInvitesViewModel.defaultState(creationParameters: creationParameters, service: service))
|
||||
}
|
||||
|
||||
|
||||
private func setupServiceObserving() {
|
||||
let publisher = service.isLoadingSubject
|
||||
.map(SpaceCreationEmailInvitesStateAction.updateLoading)
|
||||
.eraseToAnyPublisher()
|
||||
dispatch(actionPublisher: publisher)
|
||||
service
|
||||
.isLoadingSubject
|
||||
.sink(receiveValue: { [weak self] isLoading in
|
||||
self?.state.loading = isLoading
|
||||
})
|
||||
.store(in: &cancellables)
|
||||
}
|
||||
|
||||
private static func defaultState(creationParameters: SpaceCreationParameters, service: SpaceCreationEmailInvitesServiceProtocol) -> SpaceCreationEmailInvitesViewState {
|
||||
@@ -74,21 +76,13 @@ class SpaceCreationEmailInvitesViewModel: SpaceCreationEmailInvitesViewModelType
|
||||
}
|
||||
}
|
||||
|
||||
override class func reducer(state: inout SpaceCreationEmailInvitesViewState, action: SpaceCreationEmailInvitesStateAction) {
|
||||
switch action {
|
||||
case .updateEmailValidity(let emailValidity):
|
||||
state.emailAddressesValid = emailValidity
|
||||
case .updateLoading(let isLoading):
|
||||
state.loading = isLoading
|
||||
}
|
||||
}
|
||||
|
||||
private func done() {
|
||||
creationParameters.emailInvites = context.emailInvites
|
||||
creationParameters.inviteType = .email
|
||||
let emailAddressesValidity = service.validate(context.emailInvites)
|
||||
|
||||
dispatch(action: .updateEmailValidity(emailAddressesValidity))
|
||||
let emailAddressesValidity = service.validate(context.emailInvites)
|
||||
state.emailAddressesValid = emailAddressesValidity
|
||||
|
||||
if context.emailInvites.reduce(true, { $0 && $1.isEmpty }) {
|
||||
completion?(.done)
|
||||
} else if emailAddressesValidity.reduce(true, { $0 && $1 }) {
|
||||
|
||||
@@ -1,22 +0,0 @@
|
||||
// File created from TemplateAdvancedRoomsExample
|
||||
// $ createSwiftUITwoScreen.sh Spaces/SpaceCreation SpaceCreation SpaceCreationMenu SpaceCreationSettings
|
||||
//
|
||||
// Copyright 2021 New Vector Ltd
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
//
|
||||
|
||||
import Foundation
|
||||
|
||||
/// Actions to be performed on the `ViewModel` State
|
||||
enum SpaceCreationMenuStateAction { }
|
||||
@@ -19,7 +19,7 @@
|
||||
import Combine
|
||||
import SwiftUI
|
||||
|
||||
typealias SpaceCreationMenuViewModelType = StateStoreViewModel<SpaceCreationMenuViewState, SpaceCreationMenuStateAction, SpaceCreationMenuViewAction>
|
||||
typealias SpaceCreationMenuViewModelType = StateStoreViewModel<SpaceCreationMenuViewState, SpaceCreationMenuViewAction>
|
||||
|
||||
class SpaceCreationMenuViewModel: SpaceCreationMenuViewModelType, SpaceCreationMenuViewModelProtocol {
|
||||
// MARK: - Properties
|
||||
|
||||
@@ -19,7 +19,7 @@
|
||||
import Combine
|
||||
import SwiftUI
|
||||
|
||||
typealias SpaceCreationPostProcessViewModelType = StateStoreViewModel<SpaceCreationPostProcessViewState, SpaceCreationPostProcessStateAction, SpaceCreationPostProcessViewAction>
|
||||
typealias SpaceCreationPostProcessViewModelType = StateStoreViewModel<SpaceCreationPostProcessViewState, SpaceCreationPostProcessViewAction>
|
||||
|
||||
class SpaceCreationPostProcessViewModel: SpaceCreationPostProcessViewModelType, SpaceCreationPostProcessViewModelProtocol {
|
||||
// MARK: - Properties
|
||||
@@ -57,10 +57,21 @@ class SpaceCreationPostProcessViewModel: SpaceCreationPostProcessViewModelType,
|
||||
}
|
||||
|
||||
private func setupTasksObserving() {
|
||||
let tasksUpdatePublisher = spaceCreationPostProcessService.tasksSubject
|
||||
.map(SpaceCreationPostProcessStateAction.updateTasks)
|
||||
.eraseToAnyPublisher()
|
||||
dispatch(actionPublisher: tasksUpdatePublisher)
|
||||
spaceCreationPostProcessService
|
||||
.tasksSubject
|
||||
.sink(receiveValue: { [weak self] tasks in
|
||||
guard let self = self else { return }
|
||||
|
||||
self.state.tasks = tasks
|
||||
self.state.isFinished = tasks.first?.state == .failure || tasks.reduce(true) { result, task in result && task.isFinished }
|
||||
self.state.errorCount = tasks.reduce(0) { result, task in result + (task.state == .failure ? 1 : 0) }
|
||||
|
||||
NotificationCenter.default.post(name: SpaceCreationPostProcessViewModel.didUpdate,
|
||||
object: nil,
|
||||
userInfo: [SpaceCreationPostProcessViewModel.newStateKey: self.state])
|
||||
})
|
||||
.store(in: &cancellables)
|
||||
|
||||
updateNotificationObserver = NotificationCenter.default.addObserver(forName: SpaceCreationPostProcessViewModel.didUpdate, object: nil, queue: OperationQueue.main) { [weak self] notification in
|
||||
guard let self = self else {
|
||||
return
|
||||
@@ -100,19 +111,6 @@ class SpaceCreationPostProcessViewModel: SpaceCreationPostProcessViewModelType,
|
||||
}
|
||||
}
|
||||
|
||||
override class func reducer(state: inout SpaceCreationPostProcessViewState, action: SpaceCreationPostProcessStateAction) {
|
||||
switch action {
|
||||
case .updateTasks(let tasks):
|
||||
state.tasks = tasks
|
||||
state.isFinished = tasks.first?.state == .failure || tasks.reduce(true) { result, task in result && task.isFinished }
|
||||
state.errorCount = tasks.reduce(0) { result, task in result + (task.state == .failure ? 1 : 0) }
|
||||
}
|
||||
|
||||
NotificationCenter.default.post(name: SpaceCreationPostProcessViewModel.didUpdate, object: nil, userInfo: [SpaceCreationPostProcessViewModel.newStateKey: state])
|
||||
|
||||
UILog.debug("[SpaceCreationPostProcessViewModel] reducer with action \(action) produced state: \(state)")
|
||||
}
|
||||
|
||||
private func done(spaceId: String) {
|
||||
completion?(.done(spaceId))
|
||||
}
|
||||
|
||||
@@ -1,21 +0,0 @@
|
||||
// File created from SimpleUserProfileExample
|
||||
// $ createScreen.sh Spaces/SpaceCreation/SpaceCreationRooms SpaceCreationRooms
|
||||
//
|
||||
// Copyright 2021 New Vector Ltd
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
//
|
||||
|
||||
import Foundation
|
||||
|
||||
enum SpaceCreationRoomsStateAction { }
|
||||
@@ -19,7 +19,7 @@
|
||||
import Combine
|
||||
import SwiftUI
|
||||
|
||||
typealias SpaceCreationRoomsViewModelType = StateStoreViewModel<SpaceCreationRoomsViewState, SpaceCreationRoomsStateAction, SpaceCreationRoomsViewAction>
|
||||
typealias SpaceCreationRoomsViewModelType = StateStoreViewModel<SpaceCreationRoomsViewState, SpaceCreationRoomsViewAction>
|
||||
|
||||
class SpaceCreationRoomsViewModel: SpaceCreationRoomsViewModelType, SpaceCreationRoomsViewModelProtocol {
|
||||
// MARK: - Setup
|
||||
@@ -59,8 +59,6 @@ class SpaceCreationRoomsViewModel: SpaceCreationRoomsViewModelType, SpaceCreatio
|
||||
done()
|
||||
}
|
||||
}
|
||||
|
||||
override class func reducer(state: inout SpaceCreationRoomsViewState, action: SpaceCreationRoomsStateAction) { }
|
||||
|
||||
// MARK: - Private
|
||||
|
||||
|
||||
@@ -1,29 +0,0 @@
|
||||
// File created from TemplateAdvancedRoomsExample
|
||||
// $ createSwiftUITwoScreen.sh Spaces/SpaceCreation SpaceCreation SpaceCreationMenu SpaceCreationSettings
|
||||
//
|
||||
// Copyright 2021 New Vector Ltd
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
//
|
||||
|
||||
import Foundation
|
||||
import UIKit
|
||||
|
||||
/// Actions to be performed on the `ViewModel` State
|
||||
enum SpaceCreationSettingsStateAction {
|
||||
case updateRoomNameError(String?)
|
||||
case updateRoomDefaultAddress(String)
|
||||
case updateAddressValidationStatus(SpaceCreationSettingsAddressValidationStatus)
|
||||
case updateAvatar(AvatarInputProtocol)
|
||||
case updateAvatarImage(UIImage?)
|
||||
}
|
||||
@@ -19,7 +19,7 @@
|
||||
import Combine
|
||||
import SwiftUI
|
||||
|
||||
typealias SpaceCreationSettingsViewModelType = StateStoreViewModel<SpaceCreationSettingsViewState, SpaceCreationSettingsStateAction, SpaceCreationSettingsViewAction>
|
||||
typealias SpaceCreationSettingsViewModelType = StateStoreViewModel<SpaceCreationSettingsViewState, SpaceCreationSettingsViewAction>
|
||||
|
||||
class SpaceCreationSettingsViewModel: SpaceCreationSettingsViewModelType, SpaceCreationSettingsViewModelProtocol {
|
||||
// MARK: - Properties
|
||||
@@ -44,20 +44,27 @@ class SpaceCreationSettingsViewModel: SpaceCreationSettingsViewModelType, SpaceC
|
||||
}
|
||||
|
||||
private func setupServiceObserving() {
|
||||
let defaultAddressUpdatePublisher = spaceCreationSettingsService.defaultAddressSubject
|
||||
.map(SpaceCreationSettingsStateAction.updateRoomDefaultAddress)
|
||||
.eraseToAnyPublisher()
|
||||
dispatch(actionPublisher: defaultAddressUpdatePublisher)
|
||||
spaceCreationSettingsService
|
||||
.defaultAddressSubject
|
||||
.sink(receiveValue: { [weak self] address in
|
||||
self?.state.defaultAddress = address
|
||||
})
|
||||
.store(in: &cancellables)
|
||||
|
||||
let addressValidationUpdatePublisher = spaceCreationSettingsService.addressValidationSubject
|
||||
.map(SpaceCreationSettingsStateAction.updateAddressValidationStatus)
|
||||
.eraseToAnyPublisher()
|
||||
dispatch(actionPublisher: addressValidationUpdatePublisher)
|
||||
spaceCreationSettingsService
|
||||
.addressValidationSubject
|
||||
.sink(receiveValue: { [weak self] status in
|
||||
self?.state.addressMessage = status.message
|
||||
self?.state.isAddressValid = status.isValid
|
||||
})
|
||||
.store(in: &cancellables)
|
||||
|
||||
let avatarUpdatePublisher = spaceCreationSettingsService.avatarViewDataSubject
|
||||
.map(SpaceCreationSettingsStateAction.updateAvatar)
|
||||
.eraseToAnyPublisher()
|
||||
dispatch(actionPublisher: avatarUpdatePublisher)
|
||||
spaceCreationSettingsService
|
||||
.avatarViewDataSubject
|
||||
.sink(receiveValue: { [weak self] avatar in
|
||||
self?.state.avatar = avatar
|
||||
})
|
||||
.store(in: &cancellables)
|
||||
}
|
||||
|
||||
private static func defaultState(creationParameters: SpaceCreationParameters, validationStatus: SpaceCreationSettingsAddressValidationStatus) -> SpaceCreationSettingsViewState {
|
||||
@@ -84,7 +91,7 @@ class SpaceCreationSettingsViewModel: SpaceCreationSettingsViewModelType, SpaceC
|
||||
|
||||
func updateAvatarImage(with image: UIImage?) {
|
||||
creationParameters.userSelectedAvatar = image
|
||||
dispatch(action: .updateAvatarImage(image))
|
||||
state.avatarImage = image
|
||||
}
|
||||
|
||||
override func process(viewAction: SpaceCreationSettingsViewAction) {
|
||||
@@ -101,7 +108,7 @@ class SpaceCreationSettingsViewModel: SpaceCreationSettingsViewModelType, SpaceC
|
||||
spaceCreationSettingsService.roomName = newValue
|
||||
creationParameters.address = spaceCreationSettingsService.defaultAddressSubject.value
|
||||
creationParameters.name = newValue
|
||||
dispatch(action: .updateRoomNameError(newValue.isEmpty ? VectorL10n.spacesCreationEmptyRoomNameError : nil))
|
||||
state.roomNameError = newValue.isEmpty ? VectorL10n.spacesCreationEmptyRoomNameError : nil
|
||||
case .addressChanged(let newValue):
|
||||
spaceCreationSettingsService.userDefinedAddress = newValue
|
||||
creationParameters.userDefinedAddress = newValue
|
||||
@@ -109,28 +116,12 @@ class SpaceCreationSettingsViewModel: SpaceCreationSettingsViewModelType, SpaceC
|
||||
creationParameters.topic = newValue
|
||||
}
|
||||
}
|
||||
|
||||
override class func reducer(state: inout SpaceCreationSettingsViewState, action: SpaceCreationSettingsStateAction) {
|
||||
switch action {
|
||||
case .updateRoomNameError(let error):
|
||||
state.roomNameError = error
|
||||
case .updateRoomDefaultAddress(let defaultAddress):
|
||||
state.defaultAddress = defaultAddress
|
||||
case .updateAddressValidationStatus(let validationStatus):
|
||||
state.addressMessage = validationStatus.message
|
||||
state.isAddressValid = validationStatus.isValid
|
||||
case .updateAvatar(let avatar):
|
||||
state.avatar = avatar
|
||||
case .updateAvatarImage(let image):
|
||||
state.avatarImage = image
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// MARK: - Private
|
||||
|
||||
private func done() {
|
||||
guard !context.roomName.isEmpty else {
|
||||
dispatch(action: .updateRoomNameError(VectorL10n.spacesCreationEmptyRoomNameError))
|
||||
state.roomNameError = VectorL10n.spacesCreationEmptyRoomNameError
|
||||
return
|
||||
}
|
||||
|
||||
@@ -143,7 +134,7 @@ class SpaceCreationSettingsViewModel: SpaceCreationSettingsViewModelType, SpaceC
|
||||
creationParameters.userDefinedAddress = context.address
|
||||
creationParameters.address = spaceCreationSettingsService.defaultAddressSubject.value
|
||||
|
||||
dispatch(action: .updateRoomNameError(nil))
|
||||
state.roomNameError = nil
|
||||
callback?(.done)
|
||||
}
|
||||
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
import Combine
|
||||
import SwiftUI
|
||||
|
||||
typealias SpaceSelectorViewModelType = StateStoreViewModel<SpaceSelectorViewState, Never, SpaceSelectorViewAction>
|
||||
typealias SpaceSelectorViewModelType = StateStoreViewModel<SpaceSelectorViewState, SpaceSelectorViewAction>
|
||||
|
||||
class SpaceSelectorViewModel: SpaceSelectorViewModelType, SpaceSelectorViewModelProtocol {
|
||||
// MARK: - Properties
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
import Combine
|
||||
import SwiftUI
|
||||
|
||||
typealias SpaceSettingsViewModelType = StateStoreViewModel<SpaceSettingsViewState, Never, SpaceSettingsViewAction>
|
||||
typealias SpaceSettingsViewModelType = StateStoreViewModel<SpaceSettingsViewState, SpaceSettingsViewAction>
|
||||
|
||||
class SpaceSettingsViewModel: SpaceSettingsViewModelType, SpaceSettingsViewModelProtocol {
|
||||
// MARK: - Properties
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
|
||||
import SwiftUI
|
||||
|
||||
typealias TemplateSimpleScreenViewModelType = StateStoreViewModel<TemplateSimpleScreenViewState, Never, TemplateSimpleScreenViewAction>
|
||||
typealias TemplateSimpleScreenViewModelType = StateStoreViewModel<TemplateSimpleScreenViewState, TemplateSimpleScreenViewAction>
|
||||
|
||||
class TemplateSimpleScreenViewModel: TemplateSimpleScreenViewModelType, TemplateSimpleScreenViewModelProtocol {
|
||||
var completion: ((TemplateSimpleScreenViewModelResult) -> Void)?
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
import Combine
|
||||
import SwiftUI
|
||||
|
||||
typealias TemplateUserProfileViewModelType = StateStoreViewModel<TemplateUserProfileViewState, Never, TemplateUserProfileViewAction>
|
||||
typealias TemplateUserProfileViewModelType = StateStoreViewModel<TemplateUserProfileViewState, TemplateUserProfileViewAction>
|
||||
|
||||
class TemplateUserProfileViewModel: TemplateUserProfileViewModelType, TemplateUserProfileViewModelProtocol {
|
||||
private let templateUserProfileService: TemplateUserProfileServiceProtocol
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
import Combine
|
||||
import SwiftUI
|
||||
|
||||
typealias TemplateRoomChatViewModelType = StateStoreViewModel<TemplateRoomChatViewState, Never, TemplateRoomChatViewAction>
|
||||
typealias TemplateRoomChatViewModelType = StateStoreViewModel<TemplateRoomChatViewState, TemplateRoomChatViewAction>
|
||||
|
||||
class TemplateRoomChatViewModel: TemplateRoomChatViewModelType, TemplateRoomChatViewModelProtocol {
|
||||
enum Constants {
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
import Combine
|
||||
import SwiftUI
|
||||
|
||||
typealias TemplateRoomListViewModelType = StateStoreViewModel<TemplateRoomListViewState, Never, TemplateRoomListViewAction>
|
||||
typealias TemplateRoomListViewModelType = StateStoreViewModel<TemplateRoomListViewState, TemplateRoomListViewAction>
|
||||
|
||||
class TemplateRoomListViewModel: TemplateRoomListViewModelType, TemplateRoomListViewModelProtocol {
|
||||
private let templateRoomListService: TemplateRoomListServiceProtocol
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
|
||||
import Foundation
|
||||
|
||||
typealias UserSessionDetailsViewModelType = StateStoreViewModel<UserSessionDetailsViewState, Never, UserSessionDetailsViewAction>
|
||||
typealias UserSessionDetailsViewModelType = StateStoreViewModel<UserSessionDetailsViewState, UserSessionDetailsViewAction>
|
||||
|
||||
class UserSessionDetailsViewModel: UserSessionDetailsViewModelType, UserSessionDetailsViewModelProtocol {
|
||||
var completion: ((UserSessionDetailsViewModelResult) -> Void)?
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
|
||||
import SwiftUI
|
||||
|
||||
typealias UserSessionOverviewViewModelType = StateStoreViewModel<UserSessionOverviewViewState, Never, UserSessionOverviewViewAction>
|
||||
typealias UserSessionOverviewViewModelType = StateStoreViewModel<UserSessionOverviewViewState, UserSessionOverviewViewAction>
|
||||
|
||||
class UserSessionOverviewViewModel: UserSessionOverviewViewModelType, UserSessionOverviewViewModelProtocol {
|
||||
private let userSessionInfo: UserSessionInfo
|
||||
|
||||
@@ -16,9 +16,7 @@
|
||||
|
||||
import SwiftUI
|
||||
|
||||
typealias UserSessionsOverviewViewModelType = StateStoreViewModel<UserSessionsOverviewViewState,
|
||||
Never,
|
||||
UserSessionsOverviewViewAction>
|
||||
typealias UserSessionsOverviewViewModelType = StateStoreViewModel<UserSessionsOverviewViewState, UserSessionsOverviewViewAction>
|
||||
|
||||
class UserSessionsOverviewViewModel: UserSessionsOverviewViewModelType, UserSessionsOverviewViewModelProtocol {
|
||||
private let userSessionsOverviewService: UserSessionsOverviewServiceProtocol
|
||||
|
||||
Reference in New Issue
Block a user