3 final class Store<State, Action>: ObservableObject {
4 @Published private(set) var state: State
6 private let reducer: Reducer<State, Action>
8 init(initialState: State, reducer: @escaping Reducer<State, Action>) {
9 self.state = initialState
10 self.reducer = reducer
13 func send(_ action: Action) {
14 reducer(&state, action)
18 typealias Reducer<State, Action> = (inout State, Action) -> Void