Skip to content

Commit

Permalink
Add more missing documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
SwiftedMind committed Sep 18, 2023
1 parent ed80df1 commit a4e8f5a
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 9 deletions.
2 changes: 2 additions & 0 deletions Sources/Processed/Loadable/Loadable.swift
Original file line number Diff line number Diff line change
Expand Up @@ -346,4 +346,6 @@ extension Loadable {
}
}

/// An object providing an interface for automatic control over the loading process,
/// through a set of easy to use methods.
public typealias LoadableBinding<Value> = Loadable<Value>.Binding
2 changes: 2 additions & 0 deletions Sources/Processed/Process/Process.swift
Original file line number Diff line number Diff line change
Expand Up @@ -347,4 +347,6 @@ extension Process {
}
}

/// An object providing an interface for automatic control over the loading process,
/// through a set of easy to use methods.
public typealias ProcessBinding<SingleProcess: Equatable> = Process<SingleProcess>.Binding
22 changes: 13 additions & 9 deletions Sources/Processed/Process/ProcessState.swift
Original file line number Diff line number Diff line change
Expand Up @@ -22,20 +22,24 @@

import Foundation

/// Represents the possible states of a process.
/// An enumeration representing the possible states of a process.
public enum ProcessState<ProcessID> {

/// Represents the state where the process is currently not running and has no result or error.
case idle

/// Represents the state where the process is currently running.
/// - Parameter ProcessID: The process that is running.
case running(ProcessID)

/// Represents the state where the process has finished with an error.
/// - Parameter process: The process that has thrown an error.
/// - Parameter error: The thrown error.
case failed(process: ProcessID, error: Swift.Error)

/// Represents the state where the process has finished successfully.
/// - Parameter process: The process that has finished.
case finished(ProcessID)

public init(initialState: ProcessState) {
self = initialState
}

public init(initialState: ProcessState) where ProcessID == SingleProcess {
self = initialState
}
}

extension ProcessState: CustomDebugStringConvertible {
Expand Down

0 comments on commit a4e8f5a

Please sign in to comment.