Umi — API References - v1.3.0
Preparing search index...
umi-tasks
Task
Class Task<T, I>
Type Parameters
T
I
extends
any
[]
=
[
]
Index
Constructors
constructor
Methods
get
Children
get
Context
get
Descendants
get
Error
get
Result
get
Status
is
Canceled
is
Completed
is
Failed
is
Pending
is
Running
is
Successful
load
With
on
Cancel
on
Failure
on
Status
Change
on
Status
Change
To
on
Success
reset
run
set
Children
set
Context
Constructors
constructor
new
Task
<
T
,
I
extends
any
[]
=
[
]
>
(
callback
:
TaskCallback
<
T
,
I
>
,
children
?:
Task
<
any
,
any
[]
>
[]
,
context
?:
object
,
)
:
Task
<
T
,
I
>
Type Parameters
T
I
extends
any
[]
=
[
]
Parameters
callback
:
TaskCallback
<
T
,
I
>
children
:
Task
<
any
,
any
[]
>
[]
= []
context
:
object
= {}
Returns
Task
<
T
,
I
>
Methods
get
Children
getChildren
()
:
Task
<
any
,
any
[]
>
[]
Returns
Task
<
any
,
any
[]
>
[]
get
Context
getContext
<
C
extends
object
=
object
>
()
:
C
Type Parameters
C
extends
object
=
object
Returns
C
get
Descendants
getDescendants
()
:
Task
<
any
,
any
[]
>
[]
Returns
Task
<
any
,
any
[]
>
[]
get
Error
getError
()
:
unknown
Returns
unknown
get
Result
getResult
()
:
undefined
|
T
Returns
undefined
|
T
get
Status
getStatus
()
:
TaskStatus
Returns
TaskStatus
is
Canceled
isCanceled
()
:
boolean
Returns
boolean
is
Completed
isCompleted
()
:
boolean
Returns
boolean
is
Failed
isFailed
()
:
boolean
Returns
boolean
is
Pending
isPending
()
:
boolean
Returns
boolean
is
Running
isRunning
()
:
boolean
Returns
boolean
is
Successful
isSuccessful
()
:
boolean
Returns
boolean
load
With
loadWith
(
preloadedResult
:
T
)
:
Task
<
T
,
I
>
Parameters
preloadedResult
:
T
Returns
Task
<
T
,
I
>
on
Cancel
onCancel
(
callback
:
()
=>
unknown
)
:
Task
<
T
,
I
>
Parameters
callback
:
()
=>
unknown
Returns
Task
<
T
,
I
>
on
Failure
onFailure
(
callback
:
()
=>
unknown
)
:
Task
<
T
,
I
>
Parameters
callback
:
()
=>
unknown
Returns
Task
<
T
,
I
>
on
Status
Change
onStatusChange
(
callback
:
(
status
:
TaskStatus
)
=>
unknown
)
:
Task
<
T
,
I
>
Parameters
callback
:
(
status
:
TaskStatus
)
=>
unknown
Returns
Task
<
T
,
I
>
on
Status
Change
To
onStatusChangeTo
(
status
:
TaskStatus
,
callback
:
()
=>
unknown
)
:
Task
<
T
,
I
>
Parameters
status
:
TaskStatus
callback
:
()
=>
unknown
Returns
Task
<
T
,
I
>
on
Success
onSuccess
(
callback
:
()
=>
unknown
)
:
Task
<
T
,
I
>
Parameters
callback
:
()
=>
unknown
Returns
Task
<
T
,
I
>
reset
reset
()
:
Task
<
T
,
I
>
Returns
Task
<
T
,
I
>
run
run
(
options
?:
TaskOptions
,
...
inputs
:
I
)
:
Promise
<
T
>
Parameters
options
:
TaskOptions
= {}
...
inputs
:
I
Returns
Promise
<
T
>
set
Children
setChildren
(
children
:
Task
<
any
,
any
[]
>
[]
)
:
Task
<
T
,
I
>
Parameters
children
:
Task
<
any
,
any
[]
>
[]
Returns
Task
<
T
,
I
>
set
Context
setContext
(
context
:
object
)
:
Task
<
T
,
I
>
Parameters
context
:
object
Returns
Task
<
T
,
I
>
Settings
Member Visibility
Protected
Inherited
External
Theme
OS
Light
Dark
On This Page
Constructors
constructor
Methods
get
Children
get
Context
get
Descendants
get
Error
get
Result
get
Status
is
Canceled
is
Completed
is
Failed
is
Pending
is
Running
is
Successful
load
With
on
Cancel
on
Failure
on
Status
Change
on
Status
Change
To
on
Success
reset
run
set
Children
set
Context
Umi — API References - v1.3.0
Loading...