Swiftpack.co -  0xLeif/FlatMany as Swift Package
Swiftpack.co is a collection of thousands of indexed Swift packages. Search packages.
0xLeif/FlatMany
flatMap --> Publishers.MergeMany --> map --> collect
.package(url: "https://github.com/0xLeif/FlatMany.git", from: "0.2.0")

FlatMany

flatMap --> Publishers.MergeMany --> map --> collect

What does FlatMany do?

When you have a Publisher which has an Output that is a sequence. FlatMany makes it easy to map each element of that sequence into a publisher.

Usage

import FlatMany

Example

let task = Just<[Int]>([1, 2, 3])
    .flatMany {
        Just("\($0 * $0)").eraseToAnyPublisher()
    }
    .sink { values in
        print(values)
    }

GitHub

link
Stars: 3
Last commit: 4 weeks ago

Ad: Job Offers

iOS Software Engineer @ Perry Street Software
Perry Street Software is Jack’d and SCRUFF. We are two of the world’s largest gay, bi, trans and queer social dating apps on iOS and Android. Our brands reach more than 20 million members worldwide so members can connect, meet and express themselves on a platform that prioritizes privacy and security. We invest heavily into SwiftUI and using Swift Packages to modularize the codebase.

Release Notes

0.2.0
4 weeks ago

FlatMany

flatMap --> Publishers.MergeMany --> map --> collect

Usage

import FlatMany

Example

let task = Just<[Int]>([1, 2, 3])
    .flatMany {
        Just("\($0 * $0)").eraseToAnyPublisher()
    }
    .sink { values in
        print(values)
    }

0.2.0 Changes

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