How to use the reverse function from ramda

Find comprehensive JavaScript ramda.reverse code examples handpicked from public code repositorys.

76
77
78
79
80
81
82
83
84
85
  console.log(`status:${data.status}`, data);
}
var images
  = R.compose(
      R.join('\n'),
      R.reverse(),
      R.map(o => `![](${o.link})`),
      R.filter(e => dateInBetween(new Date(e.datetime*1000), beg, end))
    )(data.data);
console.log(images);
fork icon0
star icon6
watch icon0

33
34
35
36
37
38
39
40
41
                } else {
                    return run(ctx, fn);
                }
            },
            initialContext,
            R.reverse(args)
        );
    };
};
fork icon0
star icon1
watch icon0

129
130
131
132
133
134
135
136
137
138
let students = ['Rosser', 'Turing', 'Kleene', 'Church'];
let grades = [80, 100, 90, 99];

const first = R.head;
const getName = R.pluck(0);
const reverse = R.reverse;
const sortByGrade = R.sortBy(R.prop(1));
const combine = R.zip;
let result = R.compose(first, getName, reverse, sortByGrade, combine);
assert.equal(result(students, grades), 'Turing');
fork icon0
star icon0
watch icon1

88
89
90
91
92
93
94
95
96
97
});
function importBankFacts() {
  return new Promise((resolve) => {
    importExistingBankFacts().then((existingTransactions) => {
      importNewBankFacts().then((newTransactions) => {
        const allFacts = R.reverse(R.sortBy(
          R.prop('timestamp'),
          R.unionWith(R.eqBy(R.prop('id')), existingTransactions, newTransactions),
        ));
        exportBankFacts(allFacts);
fork icon0
star icon0
watch icon0

3983
3984
3985
3986
3987
3988
3989
3990
3991
3992
* @sig String -> String
* @param {Array|String} list
* @return {Array|String}
* @example
*
*      R.reverse([1, 2, 3]);  //=> [3, 2, 1]
*      R.reverse([1, 2]);     //=> [2, 1]
*      R.reverse([1]);        //=> [1]
*      R.reverse([]);         //=> []
*
fork icon0
star icon0
watch icon0

+ 143 other calls in file

40
41
42
43
44
45
46
47
48
const columnData = R.splitAt(y, getColumn(x))

// We want to look FROM the tree TOWARDS the edge, but the
// left and above arrays will be orders FROM the edge TOWARDS
// the tree, so we reverse them
const left = R.reverse(rowData[0])
const above = R.reverse(columnData[0])
const right = R.tail(rowData[1])
const below = R.tail(columnData[1])
fork icon0
star icon0
watch icon0

46
47
48
49
50
51
52
53
54
55
if (p2Score >= 21) return [0, 1];

return R.reduce(R.zipWith(R.add), [0, 0],
    R.map((t) => {
      const pos = (p1 + t) % 10;
      return R.reverse(
          quantumGame(
              [p2, pos],
              [p2Score, p1Score + (pos === 0 ? 10 : pos)]));
    }, possibleSeqs));
fork icon0
star icon0
watch icon0

+ 6 other calls in file

541
542
543
544
545
546
547
548
549
550
  return granularityA;
}
if (granularityA === granularityB) {
  return granularityA;
}
const aHierarchy = R.reverse(this.granularityParentHierarchy(granularityA));
const bHierarchy = R.reverse(this.granularityParentHierarchy(granularityB));
let lastIndex = Math.max(
  aHierarchy.findIndex((g, i) => g !== bHierarchy[i]),
  bHierarchy.findIndex((g, i) => g !== aHierarchy[i])
fork icon0
star icon0
watch icon0

39
40
41
42
43
44
45
46
47
48
        if (item.length == 0) return
        workingStacks[idx].push(item)
      },
    )
  }),
  R.reverse
)(stacks)

// Now let's clean up the instructions list
// - Trim any blank lines
fork icon0
star icon0
watch icon0

Other functions in ramda

Sorted by popularity

function icon

ramda.clone is the most popular function in ramda (30311 examples)