File tree Expand file tree Collapse file tree 1 file changed +3
-18
lines changed
Expand file tree Collapse file tree 1 file changed +3
-18
lines changed Original file line number Diff line number Diff line change @@ -18,25 +18,10 @@ public struct Feedback {
1818 case cancelOnNewState
1919 case continueOnNewState
2020
21- func apply< StateType : State > (
22- on sideEffect: @escaping ( StateType ) -> AnyPublisher < Event , Never > ,
21+ func apply< Input , Output > (
22+ on sideEffect: @escaping ( Input ) -> AnyPublisher < Output , Never > ,
2323 willExecuteWithStrategy: @escaping ( Feedback . Strategy ) -> Void = { _ in }
24- ) -> ( AnyPublisher < StateType , Never > ) -> AnyPublisher < Event , Never > {
25- return { states in
26- willExecuteWithStrategy ( self )
27- switch self {
28- case . cancelOnNewState:
29- return states. map ( sideEffect) . switchToLatest ( ) . eraseToAnyPublisher ( )
30- case . continueOnNewState:
31- return states. flatMap ( sideEffect) . eraseToAnyPublisher ( )
32- }
33- }
34- }
35-
36- func apply(
37- on sideEffect: @escaping ( State ) -> AnyPublisher < Event , Never > ,
38- willExecuteWithStrategy: @escaping ( Feedback . Strategy ) -> Void = { _ in }
39- ) -> ( AnyPublisher < State , Never > ) -> AnyPublisher < Event , Never > {
24+ ) -> ( AnyPublisher < Input , Never > ) -> AnyPublisher < Output , Never > {
4025 return { states in
4126 willExecuteWithStrategy ( self )
4227 switch self {
You can’t perform that action at this time.
0 commit comments