How to compose functions of varying arity using Lodash flow?
问题 I want to do some function composition. I know already this: If f3(x) shall be the same as f1(f2(x)) then f3 = _.flowRight(f1,f2); If f3(x,y) shall be the same as f1(x, f2(y)) then …? (The use case is the composition of node.js/express middleware functions.) 回答1: In the following images, I use {_} as a placeholder for a value. Think of it as a hole in the code where we pass something in. Ok let's imagine what your function would have to do... Does this seems like a generic transformation? ie,