CombineExt provides a collection of operators, publishers and utilities for Combine, that are not provided by Apple themselves, but are common in other Reactive Frameworks and standards.
let publishers: [AnyPublisher<Int, Never>] = []
model.subscription = publishers.combineLatest().sink(receiveValue: { print($0) })
// No output
in which I would expect to have [] rather than nothing. In my case, the current behavior arose a bug in my application as I expected there would always an output no matter how many publishers. I had to manually substitute Just([]) when 0 publishers.
As noted in the CombineExt README, CombineExt was inspired by RxSwift. I just checked the behavior in RxSwift:
Hello, I want to confirm the
CombineLatestMany
behavior for 0 publishers. Unlike:Zero publishers result in
in which I would expect to have
[]
rather than nothing. In my case, the current behavior arose a bug in my application as I expected there would always an output no matter how many publishers. I had to manually substituteJust([])
when 0 publishers.As noted in the CombineExt README, CombineExt was inspired by RxSwift. I just checked the behavior in RxSwift:
and if 0 observables:
Wonder if we would prefer aligning this case as RxSwift does?