`collect()` is a powerful operator that enables us to receive all at once the outputs from a publisher.

It collects all received elements, and emits a single array of the collection when the upstream publisher finishes.

[0, 1, 2, 3].publisher
.sink { (output) in
print(output)
}.store(in: &subscriptions)

The publisher will…

--

--