willconant/flow-js — Issue #4: `MULTI()` does not apply `resultId` to the results array
Author: KrofDrakula
Created: 2011-12-07 12:02:08+00:00
State: open

We're using Backbone models and collections in combination with flow-js to sync API calls. As per your example, `MULTI()` takes a parameter that allows it to identify a result when multiple async methods are required to complete before continuing. However:

```coffeescript
flow.exec(
->
aCb = @MULTI 'a'
bCb = @MULTI 'b'
aModel.fetch success: aCb, error: aCb
bModel.fetch success: bCb, error: bCb
(results) ->
console.debug results # => [Array[2], Array[2]]
)
```

The code returns a numerically indexed array instead, so your example of `results['a]` and `results['b']` return `undefined`.