Swiftpack.co - TrGiLong/RxConcurrency as Swift Package

Swiftpack.co is a collection of thousands of indexed Swift packages. Search packages.
See all packages published by TrGiLong.
TrGiLong/RxConcurrency 0.1.0
A small set of extensions that allow to combine new swift concurrency with RxSwift.
⭐️ 0
🕓 2 weeks ago
iOS macOS watchOS tvOS
.package(url: "https://github.com/TrGiLong/RxConcurrency.git", from: "0.1.0")

RxConcurrency

A small set of extensions that allow to combine new swift concurrency with RxSwift.

This package is actively under development. I appreciate any code improvements or new features.

import RxSwift
import RxConcurrency

// Flatmap async function
Observable
    .from([1, 2, 3, 4])
    .flatMap { (id) async throws -> Item  in
        try await ApiClient.fetch(id: id)
    }
    .subscribe { item in 
        print(item)
    }

// Observable from async function
Observable<String>
    .async {
        try await ApiClient.request(id: 1)
    }
    .subscribe { item in 
        print(item)
    }

Supported async operator

  1. flatMap
  2. flatMapFirst
  3. flatMapLatest

GitHub

link
Stars: 0
Last commit: 2 weeks ago
jonrohan Something's broken? Yell at me @ptrpavlik. Praise and feedback (and money) is also welcome.

Dependencies

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