Liking cljdoc? Tell your friends :D

js.Promise

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

The Promise object represents the eventual completion (or failure)
an asynchronous operation, and its resulting value.
raw docstring

allcljs

(all this iterable)

Method.

The Promise.all() method returns a single js.Promise that resolves all of the promises passed as an iterable have resolved or when iterable contains no promises. It rejects with the reason of first promise that rejects. There is no implied ordering in the of the array of Promises given. On some computers, they may be in parallel, or in some sense concurrently, while on others they be executed serially. For this reason, there must be no dependency any Promise on the order of execution of the Promises.

Promise.all(iterable);

See also: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise/all

Method.

The Promise.all() method returns a single `js.Promise` that resolves
all of the promises passed as an iterable have resolved or when
iterable contains no promises. It rejects with the reason of
first promise that rejects. There is no implied ordering in the
of the array of Promises given. On some computers, they may be
in parallel, or in some sense concurrently, while on others they
be executed serially. For this reason, there must be no dependency
any Promise on the order of execution of the Promises.

`Promise.all(iterable);`

See also: `https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise/all`
sourceraw docstring

all-settledcljs

(all-settled this iterable)

Method.

The Promise.allSettled() method returns a promise that resolves all of the given promises have either resolved or rejected, with array of objects that each describe the outcome of each promise.

promise.allSettled(iterable);

See also: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise/allSettled

Method.

The Promise.allSettled() method returns a promise that resolves
all of the given promises have either resolved or rejected, with
array of objects that each describe the outcome of each promise.

`promise.allSettled(iterable);`

See also: `https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise/allSettled`
sourceraw docstring

catchcljs

(catch this & args)

Method.

The catch() method returns a js.Promise and deals with rejected only. It behaves the same as calling `Promise.prototype.then(undefined, (in fact, calling obj.catch(onRejected) internally calls obj.then(undefined, This means that you have to provide an onRejected function even you want to fall back to an undefined result value - for example => {}).

`p.catch(onRejected);

p.catch(function(reason) { // rejection });`

See also: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise/catch

Method.

The catch() method returns a `js.Promise` and deals with rejected
only. It behaves the same as calling `Promise.prototype.then(undefined,
(in fact, calling obj.catch(onRejected) internally calls obj.then(undefined,
This means that you have to provide an onRejected function even
you want to fall back to an undefined result value - for example
=> {}).

`p.catch(onRejected);

p.catch(function(reason) {
// rejection
});`

See also: `https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise/catch`
sourceraw docstring

finallycljs

(finally this & args)

Method.

The finally() method returns a js.Promise. When the promise settled, i.e either fulfilled or rejected, the specified callback is executed. This provides a way for code to be run whether the was fulfilled successfully or rejected once the Promise has been with.

`p.finally(onFinally);

p.finally(function() { // settled (fulfilled or rejected) });`

See also: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise/finally

Method.

The finally() method returns a `js.Promise`. When the promise
settled, i.e either fulfilled or rejected, the specified callback
is executed. This provides a way for code to be run whether the
was fulfilled successfully or rejected once the Promise has been
with.

`p.finally(onFinally);

p.finally(function() {
// settled (fulfilled or rejected)
});`

See also: `https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise/finally`
sourceraw docstring

lengthcljs

(length this)

Property.

Length property whose value is always 1 (number of constructor

Property.

Length property whose value is always 1 (number of constructor
sourceraw docstring

prototypecljs

(prototype this)

Property.

The Promise.prototype property represents the prototype for the constructor.

See also: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise/prototype

Property.

The Promise.prototype property represents the prototype for the
constructor.

See also: `https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise/prototype`
sourceraw docstring

racecljs

(race this iterable)

Method.

The Promise.race() method returns a promise that fulfills or as soon as one of the promises in an iterable fulfills or rejects, the value or reason from that promise.

Promise.race(iterable);

See also: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise/race

Method.

The Promise.race() method returns a promise that fulfills or
as soon as one of the promises in an iterable fulfills or rejects,
the value or reason from that promise.

`Promise.race(iterable);`

See also: `https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise/race`
sourceraw docstring

rejectcljs

(reject this reason)

Method.

The Promise.reject() method returns a Promise object that is with a given reason.

Promise.reject(reason);

See also: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise/reject

Method.

The Promise.reject() method returns a Promise object that is
with a given reason.

`Promise.reject(reason);`

See also: `https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise/reject`
sourceraw docstring

resolvecljs

(resolve this value)

Method.

The Promise.resolve() method returns a js.Promise object that resolved with a given value. If the value is a promise, that is returned; if the value is a thenable (i.e. has a `"then" the returned promise will "follow" that thenable, adopting eventual state; otherwise the returned promise will be fulfilled the value. This function flattens nested layers of promise-like (e.g. a promise that resolves to a promise that resolves to something) a single layer.

Promise.resolve(value);

See also: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise/resolve

Method.

The Promise.resolve() method returns a `js.Promise` object that
resolved with a given value. If the value is a promise, that
is returned; if the value is a thenable (i.e. has a `\"then\"
the returned promise will \"follow\" that thenable, adopting
eventual state; otherwise the returned promise will be fulfilled
the value. This function flattens nested layers of promise-like
(e.g. a promise that resolves to a promise that resolves to something)
a single layer.

`Promise.resolve(value);`

See also: `https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise/resolve`
sourceraw docstring

set-length!cljs

(set-length! this val)

Property.

Length property whose value is always 1 (number of constructor

Property.

Length property whose value is always 1 (number of constructor
sourceraw docstring

set-prototype!cljs

(set-prototype! this val)

Property.

The Promise.prototype property represents the prototype for the constructor.

See also: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise/prototype

Property.

The Promise.prototype property represents the prototype for the
constructor.

See also: `https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise/prototype`
sourceraw docstring

thencljs

(then this & args)

Method.

The then() method returns a js.Promise. It takes up to two callback functions for the success and failure cases of the Promise.

`p.then(onFulfilled[, onRejected]);

p.then(value => { // fulfillment }, reason => { // rejection });`

See also: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise/then

Method.

The then() method returns a `js.Promise`. It takes up to two
callback functions for the success and failure cases of the Promise.

`p.then(onFulfilled[, onRejected]);

p.then(value => {
// fulfillment
}, reason => {
// rejection
});`

See also: `https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise/then`
sourceraw docstring

cljdoc is a website building & hosting documentation for Clojure/Script libraries

× close