Using highland.js to perform async tasks in series with references to original stream data
问题 I have a stream of events: var eventStream = _([{ id: 1, foo: 'bar' }, { id: 2, foo: 'baz' }]); For each event in the stream I need to load an instance of a model (my DAL returns promises) and then call a method on each instance of the model, passing some data from the original event data as an argument. Loading instances of the model was not too difficult: eventStream.map(function(data) { return getModelPromise(data.id); }).map(_).merge(); // result is a stream of model instances But once I