These are chat archives for ramda/ramda
const moveItem = curry((oldIndex, newIndex, arr) => insert(newIndex, arr[oldIndex], remove(oldIndex, 1, arr)) )
hasApples(data)function which returns a boolean. sometimes i need to use it along a
pipeand i do
pipe(foo, hasApples, bar)and it's all good. however when i need to check whether there are no apples i do
pipe(foo, data => !hasApples(data), bar)which is rather ugly. any ideas?
complement(hasApples)isn't really readable. i would expect
not(hasApples)to work better
notas a function alternative to
not( true ) //=> falsebut
complement( () => true ) //=> false
complementwe've got similar scenarios with
or. Functions that operate on values vs functions that operate on functions.
const doesntHaveApples = R.complement(hasApples)
either. I had no counter-argument to the suggestion that those names were better-suited for the functions acting as replacements for the built-in operators. But I'm still unhappy about it.
R.notbe named if