philips-software/cogito

View on GitHub
workspaces/cogito-ios-app/Cogito/Key store/KeyStoreReducer.swift

Summary

Maintainability
A
0 mins
Test Coverage
A
100%
import ReSwift

func keyStoreReducer(action: Action, state: KeyStoreState?) -> KeyStoreState {
    var state = state ?? initialKeyStoreState
    switch action {
    case let fulfilled as KeyStoreActions.Fulfilled:
        state.keyStore = fulfilled.keyStore
    default:
        break
    }
    return state
}