创建一个函数,调用func时参数为相对应的transforms的返回值。
要包裹的函数。
一个函数数组,每个函数的返回值将作为func的参数。
返回新函数。
const func = (x: number, y: number) => [x, y]const add = (a: number) => a + 1const square = (a: number) => a * aconst composedFunc = overArgs(func, [add, square])composedFunc(3, 4) // [4, 16] Copy
const func = (x: number, y: number) => [x, y]const add = (a: number) => a + 1const square = (a: number) => a * aconst composedFunc = overArgs(func, [add, square])composedFunc(3, 4) // [4, 16]
创建一个函数,调用func时参数为相对应的transforms的返回值。