by tracker1 · 12y ago · 0 comments
The build-in currying of most of the methods is pretty cool as well.
For me, it's difficult to break away from using the built-ins such as Array.prototype.map/reduce etc in favor of more functional variants. The same goes for Immutables... I see the value in adjusting the code in terms of explicitness, it's still hard to get used to.
--edit
Is there something built-in to apply all the functions into the current global? I'd rather not have to do...
var R = require('ramda');
var propEq = R.use(R.pipe).over(R.get, R.eq);
over... require('ramda').assignTo(this);
var propEq = use(pipe).over(get, eq); var R = require('ramda');
with (R) {
var propEq = use(pipe).over(get, eq);
}
...Or even: var R = require('ramda');
for (var f in R) {
window[f] = R.f;
} { use, pipe, get, eq } = R
propEq = use(pipe).over(get, eq) var R = require('ramda');
for (var fn in R) if (typeof R[fn] === 'function') global[fn] = R[fn];yes: `R.installTo(global)` will pull all of the ramda functions on the `global` object