Promise

The Promise object represents the completion or failure of an asynchronous operation, and its resulting value.

Note

In Calcish, each cell evaluation waits for all promises to resolve before continuing.

Syntax

Promise

Properties

Prototype Properties

Examples

let promise = new Promise((resolve, reject) => {
    resolve(2 + 2)
})
promise.then(result => print(result))
4

async function sum(a, b) {
    return a + b
}
sum(2, 2).then(result => print(result))
4