Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Buffered subscribing, batched outputting in Combine.
extension Sequence where Element: Publisher {
func bufferedSubscribe(by size: Int) -> AnyPublisher<[Element.Output], Element.Failure> {
.flatMap(maxPublishers: .max(size)) { $0 }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment