1
1
mirror of https://github.com/qvacua/vimr.git synced 2024-12-29 16:56:40 +03:00
vimr/VimR/OpenedFileListReducer.swift

25 lines
492 B
Swift

/**
* Tae Won Ha - http://taewon.de - @hataewon
* See LICENSE
*/
import Foundation
class OpenedFileListReducer {
typealias Pair = StateActionPair<UuidState<MainWindow.State>, OpenedFileList.Action>
func reduce(_ pair: Pair) -> Pair {
var state = pair.state.payload
switch pair.action {
case let .open(buffer):
state.currentBufferToSet = buffer
}
return StateActionPair(state: UuidState(uuid: pair.state.uuid, state: state), action: pair.action)
}
}