1
1
mirror of https://github.com/qvacua/vimr.git synced 2024-12-11 07:22:23 +03:00
vimr/VimR/OpenedFileListReducer.swift

25 lines
492 B
Swift
Raw Normal View History

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