QuickBEAM.VM.PromiseState (QuickBEAM v0.10.9)

Copy Markdown View Source

Promise lifecycle: create resolved/rejected promises, chain .then/.catch/.finally, and flush microtasks.

Summary

Functions

Returns promise values as-is, otherwise wraps a value in a resolved Promise.

Runs queued microtasks until the queue is empty.

Creates a pending Promise state value.

Implements Promise.prototype.catch state transitions.

Implements Promise.prototype.finally state transitions.

Implements Promise.prototype.then state transitions.

Creates or returns a rejected Promise state value.

Resolves a Promise state and drains queued reactions.

Resolves a Promise state with normal Promise-resolution adoption.

Creates or returns a resolved Promise state value.

Functions

adopt(promise)

Returns promise values as-is, otherwise wraps a value in a resolved Promise.

drain_microtasks()

Runs queued microtasks until the queue is empty.

pending()

Creates a pending Promise state value.

promise_catch(args, this)

Implements Promise.prototype.catch state transitions.

promise_finally(arg1, arg2)

Implements Promise.prototype.finally state transitions.

promise_then(args, arg2)

Implements Promise.prototype.then state transitions.

rejected(val)

Creates or returns a rejected Promise state value.

resolve(ref, state, val)

Resolves a Promise state and drains queued reactions.

resolve_adopt(ref, obj)

Resolves a Promise state with normal Promise-resolution adoption.

resolved(val)

Creates or returns a resolved Promise state value.