You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
What would be the equivalent here to Ramda's lensPath and set functionality
constobj={a: {b: {c: 1}},d: {e: 2}}constobj2=R.set(R.lensPath(['a','b','c']),99,obj)// now let do bad things and mutateobj.d.e=99console.log(obj2)// ... e: 99 ...
It seems that only the modified path is updated, other branches of the object are left referencing nodes as before. I imagine this is for efficiency purposes, for example, illustrated in this video--only the updated node is copied.
Sanctuary will one day provide S.view, S.over, S.set, and at least one function for defining lenses (#177). This was not a high priority for me until I found myself making heavy use of lenses in a project last week, and added Ramda as a dependency just to use the handful of lens-related functions.
What would be the equivalent here to Ramda's lensPath and set functionality
It seems that only the modified path is updated, other branches of the object are left referencing nodes as before. I imagine this is for efficiency purposes, for example, illustrated in this video--only the updated node is copied.
https://youtu.be/n5REbbvRYqQ?t=15m2s
The text was updated successfully, but these errors were encountered: