Closed RustamG closed 3 years ago
Thanks for opening this discussion @RustamG.
Unfortunately I believe the behavior you're suggesting is counter-intuitive.
An array of no publishers isn't the same as a publisher of an empty array. The former is an empty stream and the later is a stream with a single value ([]
).
It would be extremely confusing having an array that has no publishers (meaning no value) and the result of that being a single value being emitted (an empty array). Perhaps you have some business logic that depends on this, but the current behavior is the right one - and it's also in-line with how Reactive Extensions / RxSwift does this.
Thanks @freak4pc. It totally makes sense. 👍
Thanks for your efforts on this set of useful features.
There's one thing that IMO should work slightly different. Although it would be a breaking change, I still wanted to bring attention to it.
The
Collection.zip()
operator returnsEmpty
publisher in case the collection is empty (source). It means that the downstream methods likemap
,flatMap
, etc. will not be called. And thereceiveValue
closure onsink()
will not be called as well. My expectation is that those methods should still be called with an empty array passed. See the following example:So, I'd changed
to
here
Please let me know your thoughts.