R.pipeWith((f, res) => R.isNil(res) ? res : f(res));
const f = pipeWhileNotNil([R.negate, R.inc])
f(null) // 1
repl url: https://ramdajs.com/repl/#?const%20pipeWhileNotNil%20%3D%20R.pipeWith%28%28f%2C%20res%29%20%3D%3E%20R.isNil%28res%29%20%3F%20res%20%3A%20f%28res%29%29%3B%0Aconst%20f%20%3D%20pipeWhileNotNil%28%5BR.negate%2C%20R.inc%5D%29%0A%0Af%28null%29%20%2F%2F%201
R.isNil(null) ? null : R.negate(null)
So R.negate runs anyway, meaning null gets negated to -0 I think
Обсуждают сегодня