1
1
mirror of https://github.com/qvacua/vimr.git synced 2024-11-28 11:35:35 +03:00
vimr/VimR/OpenedFileListReducer.swift
2017-04-30 09:25:15 +02:00

25 lines
487 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.currentBuffer = buffer
}
return StateActionPair(state: UuidState(uuid: pair.state.uuid, state: state), action: pair.action)
}
}