git ssb

2+

Dominic / pull-stream



Tree: adc35583fed37c181f0cebd5b2509ff6d4973cf2

Files: adc35583fed37c181f0cebd5b2509ff6d4973cf2 / sources.js

318 bytesRaw
1
2var readArray = exports.readArray = function (array) {
3 var i = 0
4 return function (end, cb) {
5 if(end)
6 return cb && cb(end)
7
8 cb(i >= array.length || null, array[i++])
9 }
10}
11
12var count = function () {
13 var i = 0
14 return function (end, cb) {
15 if(end) return cb && cb(end)
16 cb(null, i++)
17 }
18}
19

Built with git-ssb-web