selfrefactor / rambdax

Extended version of Rambda
https://selfrefactor.github.io/rambdax
MIT License
221 stars 26 forks source link

R.forEach 6.0.0 #59

Closed hrishikesh-k closed 4 years ago

hrishikesh-k commented 4 years ago

Hello.

As it's mentioned in changelog:

Breaking change - R.map/R.filter/R.reject/R.forEach/R.partition doesn't pass index as second argument to the predicate, when looping over arrays.

What's the way to use it otherwise? I'm having a Gatsby website, and I'm using R.forEach and R.filter. If I upgrade to 6.0.0, my website doesn't build. So, if index isn't passed anymore, is there some alternative or something that's introduced or do I have to stick with 5.1.0?

selfrefactor commented 4 years ago

Initially, when I did this breaking change, I though that I will introduce methods such as R.forEachIndexed. Then I decided against that and now I am unsure how to proceed. The change is coming from this issue. Version 6.0.0 just restore Ramda functionality. If you think that the idea of "R.forEachIndexed/R.filterIndexed/R.mapIndexed and so on" is not that bad, maybe I will apply it. For me(as I use mostly Rambdax), this is also a breaking change, which explains my initial resistance towards this change. Still, I went for increasing Ramda compatibility as this is also important.

hrishikesh-k commented 4 years ago

I see. To fix one, another one had to break. Well, as long as I'm concerned, I'll need some alternative to the R.map and R.filter as I'm not someone who can find alternative ways around it. So, from what I understood from your comment, if R.forEachIndexed and all is a solution, it'd be great if you'd add it as long as there's no additional problems that it'd be causing. But, if implementing it is not a feasible solution, I'd just stick to 5.1.0.

selfrefactor commented 4 years ago

In that case, I will proceed with adding indexed methods for map/filter/forEach. Should be ready by tomorrow.

selfrefactor commented 4 years ago

Try with version 6.1.0 - all the aforementioned methods are added. I will close the issue, but feel free to reopen if needed.