https://github.com/ivan-kleshnin/ramda.ext
Ramda extended with additional helpers
https://github.com/ivan-kleshnin/ramda.ext
Last synced: 6 months ago
JSON representation
Ramda extended with additional helpers
- Host: GitHub
- URL: https://github.com/ivan-kleshnin/ramda.ext
- Owner: ivan-kleshnin
- License: mit
- Created: 2018-01-09T14:18:14.000Z (almost 8 years ago)
- Default Branch: master
- Last Pushed: 2018-12-31T10:08:51.000Z (almost 7 years ago)
- Last Synced: 2025-04-15T04:13:26.914Z (6 months ago)
- Language: JavaScript
- Size: 47.9 KB
- Stars: 6
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.txt
Awesome Lists containing this project
README
# Paqmind/Ramda
Paqmind extensions to [Ramda](http://ramdajs.com/) mostly concerned about Lenses.
**wip**
#### Usage
```
$ npm install @paqmind/ramdax
``````js
import * as R from "@paqmind/ramdax"
```Hints: use IDE shortcuts for most common imports, check Webpack's `ProvidePlugin`.
## Extra API
The API reexports all functions from [Ramda](http://ramdajs.com/docs/) adding the following.
#### Logic
* `isNotEmpty`
* `notNil`
* `firstOk`
* `id | I` – alias `identity`
* `K` – alias `always`
* `S` – S combinator#### Lensing
* `lensify`
* `over2`
* `set2`
* `unset2`
* `view2`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](https://github.com/calmm-js/partial.lenses) design and use them.```js
R.set2("foo", "FOO", {}) // can be used instead of R.assoc
R.set2(["foo", "bar"], "BAR", {}) // can be used instead of R.assocPath
```Note: 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
* `appendFlipped`
* `prependFlipped`
* `concatFlipped`
* `takeUntil` – a companion of `takeWhile`#### Objects
* `mergeDeep` – alias `mergeDeepRight`
* `mergeFlipped`
* `mergeDeepFlipped`
* `isPlainObj`
* `flattenObj`## LICENSE
MIT