lttb / flown

Type Helpers for Flow (static typechecker)
http://npm.im/flown
MIT License
85 stars 7 forks source link

Fix direction of iteration for Reduce & ReduceRight types #14

Closed oonsamyi closed 5 years ago

oonsamyi commented 5 years ago

When uses reduce, iteration should be left to right: [1, 2, 3].reduce((acc, item) => ..., null) - the first item of iteration should be 1, the second - 2, the third - 3. When uses reduceRight, iteration should be right to left: [1, 2, 3].reduce((acc, item) => ..., null) - the first item of iteration should be 3, the second - 2, the third - 1.

lttb commented 5 years ago

thank you very much!