0.1.0 • Published 12 years ago

js-array-iterator v0.1.0

Weekly downloads
2
License
-
Repository
-
Last release
12 years ago

js-array-iterator

Stepping through an array is sometimes very useful...sometimes. This module is not a replacement for async! it is something different, I needed to call a .next() method to continue the stepping and an event fired if the next array item is arrived:

var testIterator = new Iterator([0,1,2,3,4,5]);

testIterator.on('next', function (element) {
  console.log(element);
  testIterator.next();
}).on('end', function () {
  console.log('stepped through! ;)');
});

testIterator.next();

LICENSE

MIT