UNPKG
@ldrick/trade-indicators
Version:
latest (0.7.0)
0.7.0
0.6.0
0.5.0
0.4.1
0.4.0
0.3.2
0.3.1
0.3.0
0.2.0
0.1.2
0.1.1
0.1.0
Trade Indicators
github.com/ldrick/trade-indicators
ldrick/trade-indicators
@ldrick/trade-indicators
/
dist
/
utils
/
toPromise.js
8 lines
(7 loc)
•
260 B
JavaScript
View Raw
1
2
3
4
5
6
7
8
import
{ either
as
E,
function
as
F }
from
'fp-ts/lib'
;
/** * Provides a way to transform Either to Promise. * *
@public
*/
export
const
toPromise
= (
values
) => F.
pipe
(values, E.
fold
(
(
error
) =>
Promise
.
reject
(error),
(
result
) =>
Promise
.
resolve
(result)));