selfrefactor / rambdax

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

assocPath clears all other props at the last level #18

Closed romanlv closed 6 years ago

romanlv commented 6 years ago
const source = {a: {b: {c: 0, extra: "hey"}}}
const result = R.assocPath(['a', 'b', 'c'], 42, source)
result
console.log("extra=" + R.path(['a', 'b', 'extra'], result))

expecting

result to contain all original props at a.b level, including extra

actual results

only a.b.c is left

works in original Ramda repl

selfrefactor commented 6 years ago

I will look into it. Sorry for the very delayed response.

selfrefactor commented 6 years ago

Unfortunately, I will have to go to drop this method in the upcoming major version of Rambdax. This method was initially requested and implemented in Rambda, afterwards moved here. I never have used it and felt strongly about its presence.

BTW Rambdax has a method change that does something similar which might come handy.