Suppose I have a bunch of SignalProducer
s in an array:
[SignalProducer<Car, NSError>]
How do I combine them to get one SignalProducer
that waits for all of them and gets all the Car
s?
SignalProducer<[Car], NSError>
Use case: Do a network request to an endpoint http://cardatabase.com/:car_id
for a bunch of car IDs and thus obtain multiple Car
objects. The problem is that the URLSession
function can only get a SignalProducer
for one Car
at a time. The question is how to combine many of them.
(Edit: Yikes, this reminds me a lot of sequenceA
in Haskell. Can I do a similar thing in ReactiveSwift?)