How to make simple Redux for SwiftUI
Issue #502 Mutation is used to mutate state synchronously. Action is like intent, either from app or from user action. Action maps to Mutation in form of Publisher to work with async action, similar to redux-observable AnyReducer is a type erasure that takes the reduce function import Combine import Foundation public protocol Reducer { associatedtype State associatedtype Mutation func reduce(state: State, mutation: Mutation) -> State } public struct AnyReducer<State, Mutation> { public let reduce: (State, Mutation) -> State public init<R: Reducer>(reducer: R) where R....