UNPKG
dashp
Version:
latest (0.11.0)
0.11.0
0.10.1
0.10.0
0.9.0
0.8.1
Utilities for monadic promises.
github.com/critocrito/dashp
critocrito/dashp
dashp
/
src
/
spread.js
11 lines
(9 loc)
•
248 B
JavaScript
View Raw
1
2
3
4
5
6
7
8
9
10
11
import
{
of
}
from
"./Future"
;
import
{curry2}
from
"./internal/curry"
;
import
{isArray}
from
"./internal/is"
;
export
default
curry2
(
"spread"
,
(
f, p
) =>
of
(p).
then
(
(
args
) =>
{
if
(
isArray
(args))
return
f
(...args);
return
f
(args); }), );