useAsyncOrder
Hook to manage the execution order of asynchronous tasks
Code demonstration
Basic usage
API
useAsyncOrder({
task: ((
resolve?: Resolve,
reject?: InterruptibleRejectType,
index?: number
) => void)[]
option?: {
delay?: number
onReady?: () => void
onSuccess?: (result: unknown) => void
onError?: (err: unknown) => void
}})
useAsyncOrder({
task: ((
resolve?: Resolve,
reject?: InterruptibleRejectType,
index?: number
) => void)[]
option?: {
delay?: number
onReady?: () => void
onSuccess?: (result: unknown) => void
onError?: (err: unknown) => void
}})
Params
Property | Description | Type |
---|---|---|
task | aynchronous task order queue | ((resolve?: Resolve,reject?: InterruptibleRejectType,index?: number) => void)[] |
option | option | - |
Option
Property | Description | Type |
---|---|---|
delay | Delay execution | number |
onReady | Preparation phase callback | void |
onSuccess | Successful callback | (result: unknown) => void |
onError | Error callback | (err: unknown) => void |