1
1
mirror of https://github.com/qvacua/vimr.git synced 2024-11-24 03:25:03 +03:00
vimr/VimR/AdvancedPrefReducer.swift
2017-04-30 09:25:15 +02:00

27 lines
533 B
Swift

/**
* Tae Won Ha - http://taewon.de - @hataewon
* See LICENSE
*/
import Foundation
class AdvancedPrefReducer {
typealias Pair = StateActionPair<AppState, AdvancedPref.Action>
func reduce(_ pair: Pair) -> Pair {
var state = pair.state
switch pair.action {
case let .setUseInteractiveZsh(value):
state.mainWindowTemplate.useInteractiveZsh = value
case let .setUseSnapshotUpdate(value):
state.useSnapshotUpdate = value
}
return StateActionPair(state: state, action: pair.action)
}
}