Skip to content

Instantly share code, notes, and snippets.

@splincode
Created May 8, 2019 07:57
Show Gist options
  • Select an option

  • Save splincode/e0d7c605fff6e0027c9b290e84cc8039 to your computer and use it in GitHub Desktop.

Select an option

Save splincode/e0d7c605fff6e0027c9b290e84cc8039 to your computer and use it in GitHub Desktop.
data = compose(
over(lensPath(["keys"]), append(NEW_ITEM_ID)),
over(lensPath(["count"]), x => x + 1),
set(lensPath(["items", NEW_ITEM_ID]), {
id: NEW_ITEM_ID,
name: "ITEM-NEW",
value: 0
})
)(INITIAL_DATA);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment