Files: 2d4523dffda72662b6872ac393ee20e811eee7b1 / sinks / reduce.js
209 bytesRaw
1 | |
2 | |
3 | var drain = require('./drain') |
4 | |
5 | module.exports = function reduce (reducer, acc, cb) { |
6 | return drain(function (data) { |
7 | acc = reducer(acc, data) |
8 | }, function (err) { |
9 | cb(err, acc) |
10 | }) |
11 | } |
12 | |
13 |
Built with git-ssb-web