mirror of
https://github.com/Novaloop-AG/element-x-ios.git
synced 2026-11-02 12:07:55 +00:00
Remove unnecessary marks, they bring little value
This commit is contained in:
committed by
Stefan Ceriu
parent
198127c5d7
commit
9589c689c3
@@ -32,14 +32,8 @@ import Foundation
|
||||
@dynamicMemberLookup
|
||||
@MainActor
|
||||
class ViewModelContext<ViewState: BindableState, ViewAction>: ObservableObject {
|
||||
// MARK: - Properties
|
||||
|
||||
// MARK: Private
|
||||
|
||||
fileprivate let viewActions: PassthroughSubject<ViewAction, Never>
|
||||
|
||||
// MARK: Public
|
||||
|
||||
/// Get-able/Observable `Published` property for the `ViewState`
|
||||
@Published fileprivate(set) var viewState: ViewState
|
||||
|
||||
@@ -49,15 +43,11 @@ class ViewModelContext<ViewState: BindableState, ViewAction>: ObservableObject {
|
||||
set { viewState.bindings[keyPath: keyPath] = newValue }
|
||||
}
|
||||
|
||||
// MARK: Setup
|
||||
|
||||
init(initialViewState: ViewState) {
|
||||
self.viewActions = PassthroughSubject()
|
||||
self.viewState = initialViewState
|
||||
}
|
||||
|
||||
// MARK: Public
|
||||
|
||||
/// Send a `ViewAction` to the `ViewModel` for processing.
|
||||
/// - Parameter viewAction: The `ViewAction` to send to the `ViewModel`.
|
||||
func send(viewAction: ViewAction) {
|
||||
@@ -74,10 +64,6 @@ class ViewModelContext<ViewState: BindableState, ViewAction>: ObservableObject {
|
||||
@MainActor
|
||||
class StateStoreViewModel<State: BindableState, ViewAction> {
|
||||
typealias Context = ViewModelContext<State, ViewAction>
|
||||
|
||||
// MARK: - Properties
|
||||
|
||||
// MARK: Public
|
||||
|
||||
/// For storing subscription references.
|
||||
///
|
||||
@@ -91,8 +77,6 @@ class StateStoreViewModel<State: BindableState, ViewAction> {
|
||||
get { context.viewState }
|
||||
set { context.viewState = newValue }
|
||||
}
|
||||
|
||||
// MARK: Setup
|
||||
|
||||
init(initialViewState: State) {
|
||||
context = Context(initialViewState: initialViewState)
|
||||
|
||||
Reference in New Issue
Block a user