Enumerations
The following enumerations are available globally.
-
ActionStatusis a helpful enum which can be used to describe the state of a long running action such as; submitting a form, manipulating data, running migrations, executing API requests etc.An example of what this could look like being used.
See morestruct AppState: Equatable { var migrationStatus: ActionStatus<MigrationError> = .idle }Declaration
Swift
public enum ActionStatus<ErrorType> : Equatable where ErrorType : Equatable, ErrorType : Error -
ValueStatusis a helpful enum which can be used to describe the state of a long running action that involves a value such as; fetching data from an API.An example of what this could look like being used.
See morestruct AppState: Equatable { var blogPosts: ValueStatus<[BlogPost], APIError> = .idle }Declaration
Swift
public enum ValueStatus<Value, ErrorType>: Equatable where Value: Equatable, ErrorType: Error & Equatable
Enumerations Reference