UNPKG
@hopeio/utils
Version:
latest (0.0.6)
0.0.6
0.0.5
0.0.4
0.0.3
0.0.2
0.0.1
javascript utils
github.com/hopeio/diamond
hopeio/diamond
@hopeio/utils
/
dist
/
async.es.js
23 lines
(22 loc)
•
306 B
JavaScript
View Raw
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
function
o
(
r
) {
throw
r
().
then
(
(
t
) =>
t ).
catch
(
(
t
) =>
{
throw
t; }),
Error
(
"执行失败"
); }
function
c
(
r
) {
return
new
Promise
(
(
t, e
) =>
{
setTimeout
(
() =>
{
try
{
t
(
1
); }
catch
{
e
(
0
); } }, r); }); }
export
{ o
as
doAsync, c
as
sleep };