|
|
|
|
|
by j-pb
1019 days ago
|
|
Yes, but don't forget that you can't compose `next` based iterators.
That might be a small limitation, but it means that you can't do something like. ```js
let pipelineA = map(i => i+1); // or makeComplexPipelineA();
let pipelineB = filter(i => i.isEven()); // makeComplexPipelineB();
let pipeline = pipelineA.combine(pipelineB);
let result = [1,2,3,4,5].transform(pipeline);
```
|
|
It also reinforces my view that you should try to separate logic and control flow as much as possible. At work, we use awful callback chains. There must be a better way to express the logic and hide the callback logic, even in C++ (lots of rope to … find alternative solutions.)