If we use a function constructed using pipe as part of an applySpec call, it just returns an empty object.
Here's some code to illustrate the issue:
import { applySpec, pipe, length } from "rambda";
const array = [1, 2, 3, 4, 5];
console.log(
applySpec({
len: length
})(array)
); // prints { len: 5 } This is fine
console.log(
applySpec({
len: pipe(length)
})(array)
); // prints {} <-- This is unexpected
To keep the example simple, I've used only one function in pipe, but that shouldn't matter.
You can try this out in a codesandbox here.
If we use a function constructed using
pipeas part of anapplySpeccall, it just returns an empty object.Here's some code to illustrate the issue:
To keep the example simple, I've used only one function in
pipe, but that shouldn't matter.You can try this out in a codesandbox here.