mirror of
https://github.com/qvacua/vimr.git
synced 2024-12-01 10:02:36 +03:00
30 lines
648 B
Swift
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)
|
|
}
|
|
}
|
|
}
|