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

1032 questions
-1
votes
2 answers

How to apply properties of an object to functions?

I want to apply different functions to some object properties. Lets say I have this object: const person = { name: 'John', age: 30, friends: [], }; and i have some functions that i want to apply to those properties: const upperCase = str =>…
-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
  • 371
  • 3
  • 10
-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…
John Harrison
  • 318
  • 2
  • 13
-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
  • 25
  • 4
-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
  • 1,395
  • 2
  • 18
  • 36
-1
votes
2 answers

How can i use ramda.js with this code?

I am beginning to use ramda, but have doubts about how to implement functions ramda. This code is to mount a select object to do queries for sequelize. See code: const stringRequired = string => !!string.length const numberRequired = number =>…
David Costa
  • 138
  • 10
-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
  • 3
-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
  • 1,986
  • 3
  • 17
  • 44
-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
  • 13,197
  • 18
  • 96
  • 180
-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
  • 5,565
  • 2
  • 33
  • 43
-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
  • 908
  • 1
  • 18
  • 32
1 2 3
68
69