【发布时间】:2020-07-18 18:39:57
【问题描述】:
let myPassthrough = PassthroughSubject<String, Error>()
我知道我可以使用send 向传递主题发送值:
myPassthrough.send("abc")
如何发送失败消息?
我试过了:
myPassthrough.send(Fail(error: error))
myPassthrough.send(completion: Fail(error: error))
myPassthrough.send(completion: Just(error))
myPassthrough.send(completion: error)
它们都不编译
【问题讨论】: