Gozala / reducers

Library for higher-order manipulation of collections
MIT License
181 stars 8 forks source link

pipe #14

Closed Raynos closed 11 years ago

Raynos commented 11 years ago

https://github.com/Raynos/reflex-todo/blob/master/lib/pipe.js

Gozala commented 11 years ago

Close but not quite. It does not propagates erros, it should I think.

Raynos commented 11 years ago

That depends.

promises propagate errors by saying pipe(a, b) means if a errors then emit error on b.

domains handle errors by saying pipe(a, b) a and b are now on the domain, errors go to that domain.

Not sure which is a better error handling model.

Gozala commented 11 years ago

I was thinking in terms of propagating errors from a to b. That way you don't need domain, it's just you put a capture(stream, handle) wherever you need to handle errors.

Raynos commented 11 years ago

that works good enough for me.

Gozala commented 11 years ago

If you'll send in pull request with implementation I'll gladly accept. Otherwise I'll have it in by Monday ;)