Skip to content

Instantly share code, notes, and snippets.

@JustinGanzer
JustinGanzer / StoreExample.swift
Created February 16, 2021 15:37
A playground file showing odd behavior when creating a derived Redux-like store
import SwiftUI
import Combine
//REDUX
typealias Reducer<State, Action> = (inout State, Action) -> AnyPublisher<Action, Never>?
class Store<State, Action>: ObservableObject {
@Published private(set) var state: State