Add Time Travel

This commit is contained in:
Ivan Vorobei
2019-06-06 13:54:57 +03:00
parent d49b874594
commit 838c9a51ab
24 changed files with 1122 additions and 0 deletions

View File

@@ -0,0 +1,11 @@
/// Conforming types serve as the state of a time travelable application
public protocol StateMachine {
/// Events define things that can happen within your application that change its state.
///
/// This might include things like text editing, button taps, or network responses.
associatedtype Event
/// Applies an event to the current state.
mutating func update(with event: Event)
}