Skip to content

Instantly share code, notes, and snippets.

//: Playground - noun: a place where people can play
import Foundation
enum PersonError: ErrorProtocol {
case doesNotExistInDataSource
case emailNotInPersonalData
}
struct Person {
@jon-cotton
jon-cotton / StateStore.swift
Last active June 23, 2016 16:46
Implementation of a Redux/Flux like store with a single AppState in Swift 3.0. Makes use of some of the concurrency techniques demonstrated in the WWDC 2016 talk 'Concurrent Programming With GCD in Swift 3' https://developer.apple.com/videos/play/wwdc2016/720/
//: Swift 3 State Store
import Foundation
import XCPlayground
XCPlaygroundPage.currentPage.needsIndefiniteExecution = true
protocol State {
var counter: Int { get }
}