Class: AsyncPromiseValue<T>

这是一个异步值的接口,它包含了一个value字段和一个resolved字段 value字段表示异步操作的结果,resolved字段表示异步操作是否已经完成

Type parameters

Name
T

Implements

Table of contents

Constructors

Properties

Accessors

Constructors

constructor

new AsyncPromiseValue<T>(promise)

Type parameters

Name
T

Parameters

Name Type
promise Promise<T>

Properties

_reason

Private _reason: any


_status

Private _status: any


_value

Private _value: any

Accessors

error

get error(): any

Returns

any

Implementation of

AsyncErrorValue.error


errored

get errored(): boolean

Returns

boolean

Implementation of

AsyncErrorValue.errored


resolved

get resolved(): boolean

Returns

boolean

Implementation of

AsyncErrorValue.resolved


status

get status(): "pending" | "fulfilled" | "rejected"

Returns

"pending" | "fulfilled" | "rejected"


value

get value(): null | T

Returns

null | T

Implementation of

AsyncErrorValue.value