1
1
mirror of https://github.com/qvacua/vimr.git synced 2025-01-05 12:24:30 +03:00
vimr/VimR/PrefWindowReducer.swift
2017-03-11 17:08:50 +01:00

28 lines
520 B
Swift

/**
* Tae Won Ha - http://taewon.de - @hataewon
* See LICENSE
*/
import Foundation
import RxSwift
class PrefWindowTransformer: Reducer {
typealias Pair = StateActionPair<AppState, PrefWindow.Action>
func transform(_ source: Observable<Pair>) -> Observable<Pair> {
return source.map { pair in
var state = pair.state
switch pair.action {
case .close:
state.preferencesOpen = Marked(false)
}
return StateActionPair(state: state, action: pair.action)
}
}
}