Search
Preparing search index...
The search index is not available
小游戏框架
Options
All
Public
Public/Protected
All
Inherited
Menu
小游戏框架
LitePromise
Class LitePromise<T>
Type parameters
T
Hierarchy
LitePromise
Index
Constructors
constructor
Properties
reject
resolve
rough
Stack
Depth
Accessors
pending
rejected
resolved
state
Methods
catch
execute
finally
reset
then
whatever
all
race
reject
resolve
Constructors
constructor
new
Lite
Promise<T>
(
executor
?:
Executor
<
T
>
, delayed
?:
boolean
)
:
LitePromise
<
T
>
Type parameters
T
Parameters
Optional
executor:
Executor
<
T
>
delayed:
boolean
= false
Returns
LitePromise
<
T
>
Properties
reject
reject
:
RejectTransfer
resolve
resolve
:
ResolveTransfer
<
T
>
Static
rough
Stack
Depth
rough
Stack
Depth
:
number
= 0
其实完全不能精确地代表栈调用深度, 因为一个LitePromise可能会then很多个东西.
只是用来避免极端情况.
Accessors
pending
get
pending
(
)
:
boolean
Returns
boolean
rejected
get
rejected
(
)
:
boolean
Returns
boolean
resolved
get
resolved
(
)
:
boolean
Returns
boolean
state
get
state
(
)
:
State
Returns
State
Methods
catch
catch<T2>
(
onRejected
:
(
value
:
any
)
=>
T2
|
PromiseLike
<
T2
>
)
:
LitePromise
<
T
|
T2
>
Type parameters
T2 =
never
Parameters
onRejected:
(
value
:
any
)
=>
T2
|
PromiseLike
<
T2
>
(
value
:
any
)
:
T2
|
PromiseLike
<
T2
>
Parameters
value:
any
Returns
T2
|
PromiseLike
<
T2
>
Returns
LitePromise
<
T
|
T2
>
execute
execute
(
)
:
void
Returns
void
finally
finally
(
onFinally
:
(
)
=>
void
)
:
LitePromise
<
T
>
Parameters
onFinally:
(
)
=>
void
(
)
:
void
Returns
void
Returns
LitePromise
<
T
>
reset
reset
(
)
:
void
Returns
void
then
then<T1, T2>
(
onResolved
?:
(
value
:
T
)
=>
T1
|
PromiseLike
<
T1
>
, onRejected
?:
(
value
:
any
)
=>
T2
|
PromiseLike
<
T2
>
)
:
LitePromise
<
T1
|
T2
>
Type parameters
T1 =
T
T2 =
never
Parameters
Optional
onResolved:
(
value
:
T
)
=>
T1
|
PromiseLike
<
T1
>
(
value
:
T
)
:
T1
|
PromiseLike
<
T1
>
Parameters
value:
T
Returns
T1
|
PromiseLike
<
T1
>
Optional
onRejected:
(
value
:
any
)
=>
T2
|
PromiseLike
<
T2
>
(
value
:
any
)
:
T2
|
PromiseLike
<
T2
>
Parameters
value:
any
Returns
T2
|
PromiseLike
<
T2
>
Returns
LitePromise
<
T1
|
T2
>
whatever
whatever
(
)
:
LitePromise
<
void
|
T
>
Returns
LitePromise
<
void
|
T
>
Static
all
all<T>
(
array
:
PromiseLike
<
T
>
[]
)
:
LitePromise
<
T
[]
>
Type parameters
T
Parameters
array:
PromiseLike
<
T
>
[]
Returns
LitePromise
<
T
[]
>
Static
race
race<T>
(
array
:
LitePromise
<
T
>
[]
)
:
LitePromise
<
T
>
Type parameters
T
Parameters
array:
LitePromise
<
T
>
[]
Returns
LitePromise
<
T
>
Static
reject
reject<T>
(
value
?:
any
)
:
LitePromise
<
T
>
Type parameters
T =
never
Parameters
Optional
value:
any
Returns
LitePromise
<
T
>
Static
resolve
resolve<T>
(
value
?:
T
)
:
LitePromise
<
T
>
Type parameters
T
Parameters
Optional
value:
T
Returns
LitePromise
<
T
>
Exports
Lite
Promise
constructor
reject
resolve
rough
Stack
Depth
pending
rejected
resolved
state
catch
execute
finally
reset
then
whatever
all
race
reject
resolve
Generated using
TypeDoc
其实完全不能精确地代表栈调用深度, 因为一个LitePromise可能会then很多个东西.
只是用来避免极端情况.