Liking cljdoc? Tell your friends :D

redlobster.promise


awaitcljs

(await & promises)

Takes a list of promises, and creates a promise that will realise as :redlobster.promise/realised when each promise has successfully realised, or if one or more of the promises fail, fail with the value of the first failing promise.

If the first argument is the keyword :all, then instead of failing when one of the promises fails, it will just wait for all promises to realise and realise itself with :redlobster.promise/realised regardless of the success or failure of any promise.

Takes a list of promises, and creates a promise that will realise as
`:redlobster.promise/realised` when each promise has successfully realised,
or if one or more of the promises fail, fail with the value of the first
failing promise.

If the first argument is the keyword `:all`, then instead of failing when
one of the promises fails, it will just wait for all promises to realise
and realise itself with `:redlobster.promise/realised` regardless of the
success or failure of any promise.
sourceraw docstring

defer-until-realisedcljs

(defer-until-realised promises callback)
source

IPromisecljsprotocol

failed?cljs

(failed? this)

realisecljs

(realise this value)

realised?cljs

(realised? this)

on-realisedcljs

(on-realised this on-success on-error)

realise-errorcljs

(realise-error this value)
source

on-eventcljs

(on-event ee type)

Creates a promise that fulfills with an event object when the matching event is triggered on the EventEmitter. This promise cannot fail; it will either succeed or never realise.

Creates a promise that fulfills with an event object when the matching
event is triggered on the EventEmitter. This promise cannot fail; it will
either succeed or never realise.
sourceraw docstring

promisecljs

(promise)
(promise success-value)
source

Promisecljs

source

promise-failcljs

(promise-fail error-value)
source

promise?cljs

(promise? v)
source

timeoutcljs

(timeout promise timeout)

Sets a promise to fail with :redlobster.promise/timeout after a specified number of milliseconds.

A promise that has timed out will not throw an error when you try to realise it, but the realised value will remain :redlobster.promise/timeout.

Sets a promise to fail with `:redlobster.promise/timeout` after a
specified number of milliseconds.

A promise that has timed out will not throw an error when you try to
realise it, but the realised value will remain
`:redlobster.promise/timeout`.
sourceraw docstring

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

× close