Skip to content

Instantly share code, notes, and snippets.

View gbammc's full-sized avatar
:octocat:
committing...

AlvinZhu gbammc

:octocat:
committing...
View GitHub Profile
@gbammc
gbammc / StateMachine.swift
Created October 3, 2017 03:08
StateMachine
import Foundation
protocol StateType: Hashable {}
protocol EventType: Hashable {}
struct Transition<S: StateType, E: EventType> {
let event: E
let fromState: S
let toState: S