UNPKG
gitiumiota
Version:
latest (1.0.0-alpha.1)
1.0.0-alpha.1
IOTA Client Reference Implementation
github.com/iotaledger/iota.lib.js
iotaledger/iota.lib.js
gitiumiota
/
packages
/
utils.ts
6 lines
(4 loc)
•
203 B
text/typescript
View Raw
1
2
3
4
5
6
import
*
as
Promise
from
'bluebird'
export
const
asyncPipe = <T>(...
fns
:
Array
<
(
x: T
) =>
T |
Promise
<T>>):
(
(x:
Promise
<T>) =>
Promise
<T>
) =>
(
x:
Promise
<T>
) =>
fns.
reduce
(
(
m, f
) =>
m.
then
(f), x)