TrackedOpenPromise

class Util.TrackedOpenPromise()

This represents a OpenPromise that tracks whether or not it has been resolved or rejected.

Properties


Properties

TrackedOpenPromise.[toStringTag]
Type

string

TrackedOpenPromise.state
Type

PromiseState

This value is true if and only if this promise has been resolved or rejected.

Methods

catch

TrackedOpenPromise.catch([onrejected])
Arguments
  • onrejected (null | function()) – optional The callback to execute when the Promise is rejected.

Attaches a callback for only the rejection of the Promise.

Returns

A Promise for the completion of the callback.

Return type

Promise <T | TResult>

TrackedOpenPromise.onrejected(reason)
Arguments
  • reason (any()) – None

Return type

TResult | PromiseLike <TResult>

finally

TrackedOpenPromise.finally([onfinally])
Arguments
  • onfinally (null | function()) – optional The callback to execute when the Promise is settled (fulfilled or rejected).

Attaches a callback that is invoked when the Promise is settled (fulfilled or rejected). The resolved value cannot be modified from the callback.

Returns

A Promise for the completion of the callback.

Return type

Promise <T>

TrackedOpenPromise.onfinally()
Return type

void

reject

TrackedOpenPromise.reject(error)
Arguments
  • error (any()) – None

Return type

void

resolve

TrackedOpenPromise.resolve(this, value)
Arguments
  • this (OpenPromise) – None

  • value (T | PromiseLike) – None

Return type

void

TrackedOpenPromise.resolve(this)
Arguments
  • this (OpenPromise) – None

Return type

void

then

TrackedOpenPromise.then([onfulfilled[, onrejected]])
Arguments
  • onfulfilled (null | function()) – optional The callback to execute when the Promise is resolved.

  • onrejected (null | function()) – optional The callback to execute when the Promise is rejected.

Attaches callbacks for the resolution and/or rejection of the Promise.

Returns

A Promise for the completion of which ever callback is executed.

Return type

Promise <TResult1 | TResult2>

TrackedOpenPromise.onfulfilled(value)
Arguments
  • value (T()) – None

Return type

TResult1 | PromiseLike <TResult1>

Util.onrejected(reason)
Arguments
  • reason (any()) – None

Return type

TResult2 | PromiseLike <TResult2>