Commit 63764904 by Vladislav Lagunov

Merge branch 'master' of ssh://git.bitmaster.ru:34022/npm/common

parents 0e95f6cc f179adbd
/**
* Прямая композиция
*/
export default function compose<A, B>(f: (a: A) => B): (a: A) => B;
export default function compose<A, B, C>(f: (a: A) => B, g: (b: B) => C): (a: A) => C;
export default function compose<A, B, C, D>(f: (a: A) => B, g: (b: B) => C, h: (c: C) => D): (a: A) => D;
export default function compose<A, B, C, D, E>(f: (a: A) => B, g: (b: B) => C, h: (c: C) => D, j: (d: D) => E): (a: A) => E;
export default function compose(...funcs: Function[]): Function {
return a => funcs.reduce((acc, f) => f(acc), a);
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment