Closed Raynos closed 11 years ago
We may also want a better error handling thing for reducibles of multiple values.
Maybe fold should return EventEmitter
instance and emit errors on that like a stream does.
[Example of toArray being weird][1]
@Raynos could you please submit test cases for few things that required work arounds like: https://github.com/Gozala/callback-reduce/blob/master/passback.js#L16-L18 https://github.com/Gozala/callback-reduce/blob/master/passback.js#L47-L55
@Raynos could you lpese submit test cases for workarounds so this could be closed ?
Fixed by Gozala/reducible#2
It's weird to have errors swallowed and not go anywhere.
callback-reduce
For example I use callback-reduce
And i try to fold the result, and nothing happens.
I have to manually remember to capture everything to see whether an error exists.
This only applies for reducibles with one value where
callback(source, function (err, result) { ... })
may be useful (i.e. reverse callback-reduce).toArray
When using this toArray function with a callback that throws the callback gets called with the thrown error which is really weird.
This seems to be a case of reduce somehow try catching my reducing function and passing errors I throw back to me which is super weird. Don't do that.