How to replicate PromiseKit-style chained async flow using Combine + Swift

前端 未结 3 1010
爱一瞬间的悲伤
爱一瞬间的悲伤 2020-12-31 17:27

I was using PromiseKit successfully in a project until Xcode 11 betas broke PK v7. In an effort to reduce external dependencies, I decided to scrap PromiseKit. The best repl

3条回答
  •  说谎
    说谎 (楼主)
    2020-12-31 18:02

    You can use this framework for Swift coroutines, it's also can be used with Combine - https://github.com/belozierov/SwiftCoroutine

    DispatchQueue.main.startCoroutine {
        let future: Future
        let coFuture = future.subscribeCoFuture()
        let bool = try coFuture.await()
    
    }
    

提交回复
热议问题