Swiftpack.co - rizumita/CombineAsync as Swift Package

Swiftpack.co is a collection of thousands of indexed Swift packages. Search packages.
See all packages published by rizumita.
rizumita/CombineAsync 0.1.5
Async/Await for Swift Combine
⭐️ 7
🕓 4 years ago
iOS macOS watchOS tvOS
.package(url: "https://github.com/rizumita/CombineAsync.git", from: "0.1.5")

CombineAsync

Async/Await for Combine

How to use

Install

Install as swift package.

Code

let p1 = Just<Int>(1)

async { (yield: Yield<Int>) in
    let num = try await(p1)
    yield(num)
    yield(2)
    yield(Just(3))
}.sink(receiveCompletion: { print($0) }) {
    print($0) // 1 -> 2 -> 3
}

License

MIT

GitHub

link
Stars: 7
Last commit: 4 years ago
Advertisement: IndiePitcher.com - Cold Email Software for Startups

Swiftpack is being maintained by Petr Pavlik | @ptrpavlik | @swiftpackco | API | Analytics