mirror of
https://github.com/danbee/persephone
synced 2025-03-04 08:39:11 +00:00
24 lines
420 B
Swift
24 lines
420 B
Swift
//
|
|
// ServerReducer.swift
|
|
// Persephone
|
|
//
|
|
// Created by Daniel Barber on 2/26/20.
|
|
// Copyright © 2020 Dan Barber. All rights reserved.
|
|
//
|
|
|
|
import ReSwift
|
|
|
|
func serverReducer(action: Action, state: ServerState?) -> ServerState {
|
|
var state = state ?? ServerState()
|
|
|
|
switch action {
|
|
case let action as UpdateConnectedState:
|
|
state.connected = action.connected
|
|
|
|
default:
|
|
break
|
|
}
|
|
|
|
return state
|
|
}
|