(await promise)
works with JS promises
returns [err res]
where err - a catched exception (reject) res - the result of the promise work (resolve)
(go (let [[err res] (<! (await my-promise))] (println res)))
works with JS promises returns [err res] where err - a catched exception (reject) res - the result of the promise work (resolve) (go (let [[err res] (<! (await my-promise))] (println res)))
(await-cb fnc & args)
works with functions, the last argument is the function callback
returns [err res]
err - an exception (if it happens) res - the result of the work of the callback function (nil - if there was an exception)
(go (let [[err res] (<! (await-cb my-callback))] (println res)))
works with functions, the last argument is the function callback returns [err res] err - an exception (if it happens) res - the result of the work of the callback function (nil - if there was an exception) (go (let [[err res] (<! (await-cb my-callback))] (println res)))
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close