FG42/john_titor/src/john_titor/utils.cljs

13 lines
269 B
Clojure

(ns john-titor.utils
(:require
["bluebird" :as Promise]
[clojure.core.async :refer [take!]]))
(defn wait-for
[ch]
(Promise.
(fn [resolve]
;; Handle the channel timeout here
(take! ch (fn [value]
(resolve (clj->js value)))))))