Open mafintosh opened 6 years ago
That would be awesome.
I can't seem to get a reduce
function I pass into the hyperdb constructor to invoke.
https://github.com/mafintosh/hyperdb/blob/8e9d99b46bd01d5616bfc2778392c3c0bb6fecab/lib/get.js#L96
Shouldn't like 96 pass an initial empty array to the list reducer?, eg:
if (reduce) return results.length ? results.reduce(reduce, []) : null
If I do that, the passed in function does run.
I can put together a PR for this, but wanted to sanity check that I wasn't missing something simple/stupid.
Would be neat if the reduce option had an async cousin,
reduceAsync(a, b, cb)
. Then a program could prompt a user on reduce