git ssb

2+

Dominic / pull-stream



Tree: efeaeb957c2e4f2dd28054cdb5d7b3fc44c6b654

Files: efeaeb957c2e4f2dd28054cdb5d7b3fc44c6b654 / sources / count.js

216 bytesRaw
1'use strict'
2
3module.exports = function count (max) {
4 var i = 0; max = max || Infinity
5 return function (end, cb) {
6 if(end) return cb && cb(end)
7 if(i > max)
8 return cb(true)
9 cb(null, i++)
10 }
11}
12
13
14

Built with git-ssb-web