1
1
mirror of https://github.com/qvacua/vimr.git synced 2024-12-01 10:02:36 +03:00
vimr/VimR/AdvancedPrefTransformer.swift
2017-02-28 11:10:04 +01:00

30 lines
648 B
Swift

/**
* Tae Won Ha - http://taewon.de - @hataewon
* See LICENSE
*/
import Foundation
import RxSwift
class AdvancedPrefTransformer: Transformer {
typealias Pair = StateActionPair<AppState, AdvancedPref.Action>
func transform(_ source: Observable<Pair>) -> Observable<Pair> {
return source.map { pair in
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)
}
}
}