1
1
mirror of https://github.com/bitgapp/eqMac.git synced 2024-12-12 16:24:12 +03:00
eqMac/native/app/Source/Settings/SettingsState.swift
2020-05-13 23:08:21 +01:00

33 lines
609 B
Swift

//
// SettingsState.swift
// eqMac
//
// Created by Romans Kisils on 15/07/2019.
// Copyright © 2019 Romans Kisils. All rights reserved.
//
import Foundation
import SwiftyUserDefaults
import ReSwift
struct SettingsState: State {
var iconMode: IconMode = .both
}
enum SettingsAction: Action {
case setIconMode(IconMode)
}
func SettingsStateReducer(action: Action, state: SettingsState?) -> SettingsState {
var state = state ?? SettingsState()
switch action as? SettingsAction {
case .setIconMode(let iconMode)?:
state.iconMode = iconMode
case .none:
break
}
return state
}