Last active
February 1, 2019 20:29
-
-
Save jamiepinkham/7271febc382bc591bcd3c656fdd54f31 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
protocol Action { } | |
protocol State { | |
static var initial: Self { get } | |
} | |
typealias Reducer<S: State, A: Action> = (_ state: S, _ action: A) -> S | |
enum AnAction: Action { } | |
enum AState: State { | |
case none | |
case error(Error) | |
static let initial: AState = .none | |
} | |
let reducer: Reducer<AState, AnAction> = { (state, action) in switch (state, action) {} } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment