mirror of
https://github.com/qvacua/vimr.git
synced 2024-11-28 11:35:35 +03:00
25 lines
486 B
Swift
25 lines
486 B
Swift
/**
|
|
* Tae Won Ha - http://taewon.de - @hataewon
|
|
* See LICENSE
|
|
*/
|
|
|
|
import Foundation
|
|
|
|
class BuffersListReducer {
|
|
|
|
typealias Pair = StateActionPair<UuidState<MainWindow.State>, BuffersList.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)
|
|
}
|
|
}
|