Collects all received elements, and emits a single array of the collection when the upstream publisher finishes.
- iOS 13.0+
- macOS 10.15+
- Mac Catalyst 13.0+
- tvOS 13.0+
- watchOS 6.0+
- Xcode 11.0+
A publisher that collects all received items and returns them as an array upon completion.
If the upstream publisher fails with an error, this publisher forwards the error to the downstream receiver instead of sending its output. This publisher requests an unlimited number of elements from the upstream publisher. It only sends the collected array to its downstream after a request whose demand is greater than 0 items. Note: This publisher uses an unbounded amount of memory to store the received values.