UNPKG
@antv/coord
Version:
beta (0.3.0-beta.1)
latest (0.4.7)
0.4.7
0.4.6
0.4.5
0.4.4
0.4.3
0.4.2
0.4.1
0.4.0
0.4.0-beta.3
0.4.0-beta.2
0.4.0-beta.1
0.3.1
0.3.0
0.3.0-beta.1
0.2.7
0.2.6
0.2.5
0.2.4
0.2.3
0.2.2
0.2.1
0.2.0
0.1.0
0.0.3
0.0.2
Toolkit for mapping elements of sets into geometric objects.
github.com/antvis/coord
antvis/coord
@antv/coord
/
src
/
utils
/
compose.ts
6 lines
(4 loc)
•
206 B
text/typescript
View Raw
1
2
3
4
5
6
import
{ identity }
from
'@antv/util'
;
export
function
compose<T>(fn?:
(
x: T
) =>
T, ...
rest
: (
(
x: T
) =>
T)[]) {
return
fn ? rest.
reduce
(
(
total, current
) =>
(
x: T
) =>
current
(
total
(x)), fn) : identity; }