Good news is we're only using lodash/fp, which makes it easier to match function signatures.
- Find most-used lodash methods, we'll convert these first maybe?
- Go through each lodash method, find the ramda equivalent where possible
- Write a codemod to rewrite those usages
- Who the fuck thought function aliases were a good idea
import R from 'ramda'- Use as
R.X, instead ofimport { X } from 'ramda'
- 245 x
noop- No equivalent
- 62 x
flowRightR.compose
- 26 x
identity - 16 x
curryR.curry
- 13 x
getR.path- NOTE: ramda paths use arrays, not strings
- 13 x
debounce- No equivalent
- 12 x
find_.find(collection, [predicate=_.identity], [fromIndex=0])R.find(a → Boolean) → [a] → a | undefined
- 11 x
range_.range([start=0], end, [step=1])R.rangeNumber → Number → [Number]- Does not support steps
- 9 x
findIndex_.findIndex(predicate, array)R.findIndex(a → Boolean) → [a] → Number
- 8 x
some_.some(predicate, collection)R.anyPass[(*… → Boolean)] → (*… → Boolean)
- 8 x
map_.map(iteratee, collection)R.mapFunctor f => (a → b) → f a → f b
- 7 x
flow_.flow(funcs)R.pipe
- 7 x
first- Alias of
_.head R.head
- Alias of
- 6 x
last_.last(array)R.last
- 5 x
isEqual_.isEqual(value, other)R.equalsa → b → Boolean
- 5 x
filterR.filter
- 5 x
every_.every(predicate, collection)- predicate called with (value, key|index, collection)
R.all- predicate called with (value)
- 4 x
pick_.pick(props, object)R.pick[k] → {k: v} → {k: v}
- 3 x
reduce_.reduce(iteratee, accumulator, collection)- iteratee is invoked with four arguments: (accumulator, value, index|key, collection)
R.reduce((a, b) → a) → a → [b] → a- iterator function receives two values: (acc, value)
- 3 x
rangeStep- Lodash FP's 3-arity version of
range _.rangeStep(step, start, end)- No direct equivalent, closest would be:
const rangeStep = (start, step, stop) => R.map( n => start + step * n, R.range(0, (1 + (stop - start) / step) >>> 0) );
- Lodash FP's 3-arity version of
- 3 x
compose - 2 x
values - 2 x
takeRight - 2 x
take - 2 x
split - 2 x
merge - 2 x
memoize - 2 x
inRange - 2 x
includes - 2 x
groupBy - 2 x
getOr - 2 x
concatR.concat
- 2 x
clamp_.clamp(number, [lower], upper)R.clampOrd a => a → a → a → a
- 1 x
uniqBy - 1 x
uniq - 1 x
toPairs - 1 x
toLower - 1 x
throttle - 1 x
spread - 1 x
sortBy - 1 x
slice - 1 x
set - 1 x
reverse - 1 x
replace - 1 x
reject - 1 x
pluck - 1 x
pickBy - 1 x
negate - 1 x
join - 1 x
isObject - 1 x
isEmpty - 1 x
intersection - 1 x
fromPairs - 1 x
flatten - 1 x
equals- Alias of
isEquals R.equals
- Alias of
- 1 x
delay- No equivalent
- Use
setTimeout
- 1 x
defaultTo - 1 x **
curryNR.curryN
- 1 x
ceil_.ceil(number, [precision=0])- No equivalent
- Use
Math.ceilinstead
- 1 x
assign_.assign(object, [sources])R.merge{k: v} → {k: v} → {k: v}
This is awesome! Btw, most of our usages of
noopare erroneous and need replacing. I'll be working on that soon.