Appearance
创建一个函数,返回调用所有函数后的结果,每个函数的返回值作为下一个函数的参数。
import { flow } from '@base-web-kits/base-tools-ts'; function add(x) { return x + 1; } function square(x) { return x * x; } const addSquare = flow([add, square]); addSquare(2); // 结果: 9
funcs (Array)
(Function)