Skip to content

Generic "in" operator #43

Description

@tlrobinson

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()

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions