pkrumins/node-lazy — Issue #13: No way to detect list end
Author: nponeccop
Created: 2012-01-24 12:13:46+00:00
State: open

Use case:

I need to read data from file A and then use the data to process file B:

```javascript
var foo = {}
A.lines.forEach(function (x) { foo[getKey(x) = getValue(x) })
B.lines.forEach(function (x) { if foo[getKey(x) then console.log('yo!') else console.log('yay!') })
```
The code doesn't work as intended because the two loops execute in parallel. So I need something like this:

```javascript
A.lines.forEach(function (x) { foo[getKey(x) = getValue(x) }).then(function ()
{
B.lines.forEach(function (x) { if foo[getKey(x) then console.log('yo!') else console.log('yay!') })
})
```