zenika-open-source / immutadot

immutadot is a JavaScript library to deal with nested immutable structures.
https://immutadot.zenika.com
MIT License
178 stars 5 forks source link

PoC new apply on get, set, update and add #303

Closed nlepage closed 6 years ago

nlepage commented 6 years ago

I wrote a new apply based on curry and nav and used it on set.

nlepage commented 6 years ago

You can now write:

const obj = { nested: { prop: 5 } }
apply(v => v + 1)('nested.prop')(obj)

Which can be read "apply v + 1 at nested.prop of obj"

codecov-io commented 6 years ago

Codecov Report

Merging #303 into dev will decrease coverage by 0.01%. The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##              dev     #303      +/-   ##
==========================================
- Coverage   99.17%   99.15%   -0.02%     
==========================================
  Files         106      107       +1     
  Lines         364      357       -7     
==========================================
- Hits          361      354       -7     
  Misses          3        3
Impacted Files Coverage Δ
packages/immutadot/src/path/apply.js 100% <100%> (ø) :arrow_up:
packages/immutadot/src/core/set.js 100% <100%> (ø) :arrow_up:
packages/immutadot/src/core/apply.js 100% <100%> (ø)
packages/immutadot/src/core/get.js 100% <100%> (ø) :arrow_up:
packages/immutadot/src/lang/add.js 100% <100%> (ø) :arrow_up:
packages/immutadot/src/core/update.js 100% <100%> (ø) :arrow_up:

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update 2ebf59c...ea75962. Read the comment docs.

nlepage commented 6 years ago

Extended to get, update and add.

nlepage commented 6 years ago

This is ready for review