@paqmind/ramda
v0.4.0
Published
Ramda extended with additional helpers
Maintainers
Readme
Paqmind/Ramda
Paqmind extensions to Ramda mostly concerned about Lenses.
wip
Install
$ npm install @paqmind/ramdaimport * as R from "@paqmind/ramda"Hints: use IDE shortcuts for most common imports, check Webpack's ProvidePlugin.
Extra API
The API reexports all functions from Ramda adding the following.
Logic
isNotEmptynotNilfirstOkid | I– aliasidentityK– aliasalwaysS– S combinator
Lensing
lensifyover2set2unset2view2
Allow to use strings and arrays in place of lenses. For weird reasons, Ramda doesn't support convenient shortcuts for objects and arrays. We follow Partial.Lenses design and use them.
R.set2("foo", "FOO", {}) // can be used instead of R.assoc
R.set2(["foo", "bar"], "BAR", {}) // can be used instead of R.assocPathNote: names are under consideration. We may decide to override R.set, R.over, R.view instead of adding xxx2 versions
in the future.
Indexed versions
map2–R.addIndex(R.map)filter2– ...chain2– ...reduce2– ...
Functions
withName, fn– name your anonymous functions
Arrays
appendFlippedprependFlippedconcatFlippedtakeUntil– a companion oftakeWhile
Objects
mergeDeep– aliasmergeDeepRightmergeFlippedmergeDeepFlippedisPlainObjflattenObj
LICENSE
MIT
