Skip to content

Commit 7fec6a4

Browse files
authored
Pass attemptToFulfill directly to Future (#743)
1 parent 68664c1 commit 7fec6a4

File tree

1 file changed

+1
-6
lines changed

1 file changed

+1
-6
lines changed

Sources/ComposableArchitecture/Effect.swift

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -110,12 +110,7 @@ public struct Effect<Output, Failure: Error>: Publisher {
110110
public static func future(
111111
_ attemptToFulfill: @escaping (@escaping (Result<Output, Failure>) -> Void) -> Void
112112
) -> Effect {
113-
Deferred {
114-
Future { callback in
115-
attemptToFulfill { result in callback(result) }
116-
}
117-
}
118-
.eraseToEffect()
113+
Deferred { Future(attemptToFulfill) }.eraseToEffect()
119114
}
120115

121116
/// Initializes an effect that lazily executes some work in the real world and synchronously sends

0 commit comments

Comments
 (0)