Skip to content

Commit b55f956

Browse files
committed
Introduce 'makeOutputSink' convenience on 'RenderContext'
1 parent 3451169 commit b55f956

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

Workflow/Sources/RenderContext.swift

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -148,4 +148,11 @@ extension RenderContext {
148148
}
149149
}
150150
}
151+
152+
/// Generates a sink that allows sending the Workflow's output wrapped in an AnyWorkflowAction, allowing bypassing an
153+
/// intermediate action.
154+
public func makeOutputSink() -> Sink<WorkflowType.Output> {
155+
return makeSink(of: AnyWorkflowAction.self)
156+
.contraMap { AnyWorkflowAction<WorkflowType>(sendingOutput: $0) }
157+
}
151158
}

0 commit comments

Comments
 (0)