pipe
Script
v1
Fork
1
2
3
4
export
function
pipe
<
T
>
(
seed
:
T
)
{
return
(
...
ops
:
Array
<
(
state
:
T
)
=>
T
>
)
=>
ops
.
reduce
(
(
state
,
action
)
=>
action
(
state
)
,
seed
)
;
}