mirror of
https://github.com/ivanvorobei/SwiftUI.git
synced 2026-03-18 15:34:01 +01:00
12 lines
420 B
Swift
Executable File
12 lines
420 B
Swift
Executable File
/// 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)
|
|
}
|