跳至主要內容

Class: status<CT>

muzzik小于 1 分钟

index / task / status

Class: status<CT>

task.status

状态任务(类型安全)

Remarks

封装 promise,防止重复调用 resolve 函数报错以及添加超时功能,可重复使用

Type parameters

NameType
CTvoid

Table of contents

Constructors

Properties

Accessors

Methods

Constructors

constructor

new status<CT>(finish_b_, init_config_?)

Type parameters

NameType
CTvoid

Parameters

NameTypeDescription
finish_b_boolean完成状态
init_config_?init_config<CT>初始化配置

Defined in

assets/@framework/task/mk_status_task.ts:12open in new window

Properties

task

task: Promise<CT>

异步任务

Defined in

assets/@framework/task/mk_status_task.ts:27open in new window

Accessors

finish_b

get finish_b(): boolean

完成状态

Returns

boolean

Remarks

  • true:任务结束

  • false:任务进行中

Defined in

assets/@framework/task/mk_status_task.ts:36open in new window

Methods

finish

finish<T>(finish_b_): void

完成任务

Type parameters

NameType
Textends false

Parameters

NameTypeDescription
finish_b_T完成状态

Returns

void

Defined in

assets/@framework/task/mk_status_task.ts:54open in new window

finish<T>(finish_b_, data_): void

完成任务

Type parameters

NameType
Textends true

Parameters

NameTypeDescription
finish_b_T完成状态
data_CT完成数据

Returns

void

Defined in

assets/@framework/task/mk_status_task.ts:60open in new window

📣 觉得很赞?分享给你的朋友吧!