Skip to content

Commit 3787a94

Browse files
authored
[feat]: add primary associated types to more protocols (#188)
- adds `<Rendering, Output>` PAT to `AnyWorkflowConvertible` - adds `<WorkflowType>` PAT to `WorkflowAction` - adds `<Output>` to the various definitions of `Worker`
1 parent a228063 commit 3787a94

File tree

6 files changed

+6
-6
lines changed

6 files changed

+6
-6
lines changed

Workflow/Sources/AnyWorkflowConvertible.swift

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616

1717
/// Conforming types can be converted into `AnyWorkflow` values, allowing them to participate
1818
/// in a workflow hierarchy.
19-
public protocol AnyWorkflowConvertible {
19+
public protocol AnyWorkflowConvertible<Rendering, Output> {
2020
/// The rendering type of this type's `AnyWorkflow` representation
2121
associatedtype Rendering
2222

Workflow/Sources/WorkflowAction.swift

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616

1717
/// Conforming types represent an action that advances a workflow. When applied, an action emits the next
1818
/// state and / or output for the workflow.
19-
public protocol WorkflowAction {
19+
public protocol WorkflowAction<WorkflowType> {
2020
/// The type of workflow that this action can be applied to.
2121
associatedtype WorkflowType: Workflow
2222

WorkflowCombine/Sources/Worker.swift

+1-1
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ import Workflow
2828
/// If there is, and if the workers are 'equivalent', the context leaves the existing worker running.
2929
///
3030
/// If there is not an existing worker of this type, the context will kick off the new worker (via `run`).
31-
public protocol Worker: AnyWorkflowConvertible where Rendering == Void {
31+
public protocol Worker<Output>: AnyWorkflowConvertible where Rendering == Void {
3232
/// The type of output events returned by this worker.
3333
associatedtype Output
3434
associatedtype WorkerPublisher: Publisher where

WorkflowConcurrency/Sources/Worker.swift

+1-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ import Workflow
2525
/// If there is, and if the workers are 'equivalent', the context leaves the existing worker running.
2626
///
2727
/// If there is not an existing worker of this type, the context will kick off the new worker (via `run`).
28-
public protocol Worker: AnyWorkflowConvertible where Rendering == Void {
28+
public protocol Worker<Output>: AnyWorkflowConvertible where Rendering == Void {
2929
/// The type of output events returned by this worker.
3030
associatedtype Output
3131

WorkflowReactiveSwift/Sources/Worker.swift

+1-1
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ import Workflow
2626
/// If there is, and if the workers are 'equivalent', the context leaves the existing worker running.
2727
///
2828
/// If there is not an existing worker of this type, the context will kick off the new worker (via `run`).
29-
public protocol Worker: AnyWorkflowConvertible where Rendering == Void {
29+
public protocol Worker<Output>: AnyWorkflowConvertible where Rendering == Void {
3030
/// The type of output events returned by this worker.
3131
associatedtype Output
3232

WorkflowRxSwift/Sources/Worker.swift

+1-1
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ import Workflow
2626
/// If there is, and if the workers are 'equivalent', the context leaves the existing worker running.
2727
///
2828
/// If there is not an existing worker of this type, the context will kick off the new worker (via `run`).
29-
public protocol Worker: AnyWorkflowConvertible where Rendering == Void {
29+
public protocol Worker<Output>: AnyWorkflowConvertible where Rendering == Void {
3030
/// The type of output events returned by this worker.
3131
associatedtype Output
3232

0 commit comments

Comments
 (0)