Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/0xleif/flatmany
flatMap --> Publishers.MergeMany --> map --> collect
https://github.com/0xleif/flatmany
combine publishers rx swift
Last synced: 16 days ago
JSON representation
flatMap --> Publishers.MergeMany --> map --> collect
- Host: GitHub
- URL: https://github.com/0xleif/flatmany
- Owner: 0xLeif
- License: mit
- Created: 2021-05-13T13:50:08.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2021-05-13T20:49:02.000Z (over 3 years ago)
- Last Synced: 2024-11-30T20:35:26.436Z (about 1 month ago)
- Topics: combine, publishers, rx, swift
- Language: Swift
- Homepage:
- Size: 5.86 KB
- Stars: 3
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# 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
```swift
import FlatMany
```### Example
```swift
let task = Just<[Int]>([1, 2, 3])
.flatMany {
Just("\($0 * $0)").eraseToAnyPublisher()
}
.sink { values in
print(values)
}
```