File tree Expand file tree Collapse file tree 1 file changed +11
-2
lines changed
WorkflowReactiveSwift/Sources Expand file tree Collapse file tree 1 file changed +11
-2
lines changed Original file line number Diff line number Diff line change @@ -47,18 +47,27 @@ struct SignalProducerWorkflow<Value>: Workflow {
47
47
public typealias State = Void
48
48
public typealias Rendering = Void
49
49
50
+ struct Action : WorkflowAction {
51
+ typealias WorkflowType = SignalProducerWorkflow
52
+ let output : Value
53
+
54
+ func apply( toState state: inout Void ) -> Value ? {
55
+ output
56
+ }
57
+ }
58
+
50
59
var signalProducer : SignalProducer < Value , Never >
51
60
52
61
public init ( signalProducer: SignalProducer < Value , Never > ) {
53
62
self . signalProducer = signalProducer
54
63
}
55
64
56
65
public func render( state: State , context: RenderContext < SignalProducerWorkflow > ) -> Rendering {
57
- let sink = context. makeSink ( of: AnyWorkflowAction . self)
66
+ let sink = context. makeSink ( of: Action . self)
58
67
context. runSideEffect ( key: " " ) { [ signalProducer] lifetime in
59
68
signalProducer
60
69
. take ( during: lifetime. reactiveLifetime)
61
- . map { AnyWorkflowAction ( sendingOutput : $0) }
70
+ . map { Action ( output : $0) }
62
71
. observe ( on: QueueScheduler . main)
63
72
. startWithValues ( sink. send)
64
73
}
You can’t perform that action at this time.
0 commit comments