icepick
icepick copied to clipboard
Generic "in" operator
I find assocIn etc to be useful, and sometimes wish similar functions existed for the other functions. Here's a prototype of an at (because in is a reserved word) function and chain method that let you apply any operator to a path:
https://runkit.com/tlrobinson/5dc341aa7f9859001a1b54f4
e.x.
icepick.at(object, ["foo", "bar"]).push(4)
icepick.chain(object)
.at(["foo", "bar"]).push(4)
.at(["new", "object"]).assoc(5)
.at(["new", "array"]).push(6)
.value()
I like this feature, seems very handy. Seems like it could be implemented similarly to .chain() too.