This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Combine | |
enum MyError: Error { | |
case error | |
} | |
let subject1 = PassthroughSubject<Int, Error>() | |
let cancellable1 = subject1 | |
.print("before flatMap") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@discardableResult | |
@inlinable | |
private func with<T>(_ value: T, _ builder: (T) throws -> Void) rethrows -> T { | |
try builder(value) | |
return value | |
} | |
// Use | |
class MyClass { | |
var prop = "it's" |