let myPassthrough = PassthroughSubject<String, Error>()
I know I can send a value to a passthrough subject using send
:
myPassthrough.send("abc")
How do I send a failure?
I tried:
myPassthrough.send(Fail(error: error))
myPassthrough.send(completion: Fail(error: error))
myPassthrough.send(completion: Just(error))
myPassthrough.send(completion: error)
None of them compile