Questions tagged [ramda.js]

Ramda is a functional utility library for Javascript, focusing on making it easy to build modular pipelines out of small, composable functions.

Ramda is a functional utility library for Javascript, focusing on making it easy to build modular pipelines out of small, composable functions.

Functions in Ramda are curried, meaning that if called with fewer than the required number of parameters, they will simply return new (curried) functions that require the remaining ones. Parameter order is different than the native order or the order in libraries such as Underscore or LoDash; those parameters expected to change the most (generally the data being operated on) are supplied last.

Useful Links

1196 questions
-1
votes
2 answers

How to aggregate and merge objects based on multiple properties?

I need your support to make a groupby in Ramda. I have a data and I require: Sort the data by its type of service Separate those that are the same product code Make the groupby of duration Make the merge of all the data Data: [{ 'id': '1',…
-1
votes
5 answers

Best way to get combination of array of elements in Ramda?

What is the best way to implement a function that takes three arguments smallest length of combinations highest length of combinations array of values and returns all combinations of length l (arg1 <= l <= arg2). E.g. getComb (2, 2, [1, 2, 3]) ===…
Dominik Teiml
  • 505
  • 1
  • 4
  • 12
-1
votes
4 answers

Create a zipmap function using javascript?

Consider this problem: Create a function zipmap that takes in two sequences, and creates a dictionary from the elements of the first sequence to the elements of the second. zipmap([1, 2, 3], [4, 5, 6]) => {1: 4, 2: 5, 3: 6} My solution is below as…
Storms786
  • 416
  • 1
  • 7
  • 20
-1
votes
2 answers

crawler with ramda.js (functional programming)

I'm trying to crawl movie data from TMDB website. I finished my code with pure javascript, but I want to change the code into functional programming style by using ramda.js. I attached my code below. I want to get rid of for-loop (if it is possible)…
Hyeon
  • 45
  • 5
-1
votes
1 answer

Ramda : convert duplicate arrays to objects

converting the array of object with duplicates in it using ramda var testData = [ {"id" : "001", "project" : "one", "projectstartDate" : "10/12/2018" },{"id" : "001", "project" : "two", "projectstartDate"…
sayomaka
  • 11
  • 1
-1
votes
3 answers

How to find a value in object of objects with an array of keys

for example I have an object that that has objects and arrays in itself: const object = { a: { b: [ 0: 'something', 1: { c: 'the thing that I need', }, ], }, }; and an…
-1
votes
1 answer

How do I return a component with passed props with R.ifElse?

I'm diving into ramdajs and refactoring some react code here. It might not necessary to do it in this case but for the sake of exercise how do I pass props in R.ifElse ? {!this.state.repos ? : } //…
karolis2017
  • 2,195
  • 8
  • 24
  • 49
-1
votes
1 answer

ramda JavaScript array property in an object

var data = { "factors" : [1,2,34] } I would like to multiply all the elements in the factors array by 2 using ramda JavaScript and return the updated data object.
Anamika
  • 21
  • 4
-1
votes
1 answer

Ramda: Is there a way to find particular key value is nested object?

I want to find particular key value is nested object or not. { 'a': { 'area': 'abc' }, 'b': { 'area': { 'city': 'aaaa', 'state': 'ggggg' } } } In above example, I want to find 'a' and 'b' is object or nested object?
-1
votes
1 answer

prevent duplication code with ramda

i have a list of same operation on same list using ramda like below : size: { sum: R.sum(R.map(R.prop('size'), ordersRep)) }, price: { sum: R.sum(R.map(R.prop('price'), ordersRep)) }, profit: { sum: R.sum(R.map(R.prop('profit'),…
amir
  • 2,443
  • 3
  • 22
  • 49
-1
votes
2 answers

Using R.pipe (or R.curry) to simplify functional method calls

Just started using Ramda today in an attempt to learn/incorporate functional programming into my code by being more declarative, but I'm having trouble figuring out how to make this a bit more streamlined using pipes (or curry?) This is only used…
mtpultz
  • 17,267
  • 22
  • 122
  • 201
-1
votes
4 answers

ramdajs recursion one nested JSON

const arr = [1,2,[3,4,5,[6,7,[8,9],10]]]; Lets say we have a nested array like above. Is there a specific deep recursion method? Instead of calling the same function in function or iteratively looping; is there any deepMap function which iterates…
serkan
  • 6,885
  • 4
  • 41
  • 49
-1
votes
2 answers

Functional Javascript map with index

I need a functional approach to solve a very basic problem, the problem with list indexes, let me write an example with React and ramda that shows the need of an index. const R = require('ramda'); const array = ["foo", "bar", "foobar"]; // Need to…
elaich
  • 939
  • 1
  • 19
  • 35
-1
votes
1 answer

Ramda fails with setDate function

I'm trying to learn functional javascript with Ramda and I'm stuck with this. Here is the JS Bin: http://jsbin.com/kozeka/ And this is the code: const date = new Date() const addDays = R.add(date.getDate()) const getDate = R.compose(date.setDate,…
KadoBOT
  • 2,944
  • 4
  • 16
  • 34
-1
votes
2 answers

Functional Javascript - Convert to dotted format in FP way (uses Ramda)

I am learning functional programming in Javascript and using Ramda. I have this object var fieldvalues = { name: "hello there", mobile: "1234", meta: {status: "new"}, comments: [ {user: "john", comment:…
rsmoorthy
  • 2,284
  • 1
  • 24
  • 27
1 2 3
79
80