mirror of
https://github.com/logseq/logseq.git
synced 2026-05-04 02:46:45 +00:00
enhance(rtc): deprecate <wrap-ensure-id&access-token
This commit is contained in:
@@ -1,10 +1,9 @@
|
||||
(ns frontend.common.async-util
|
||||
"Some cljs.core.async relate macros and fns, used in worker and frontend
|
||||
namespaces. See also: https://gist.github.com/vvvvalvalval/f1250cec76d3719a8343"
|
||||
#?(:cljs (:require [promesa.core :as p]
|
||||
[logseq.common.util :as common-util]
|
||||
#?(:cljs (:require [cljs.core.async.impl.channels :refer [ManyToManyChannel]]
|
||||
[clojure.core.async :as async]
|
||||
[cljs.core.async.impl.channels :refer [ManyToManyChannel]])))
|
||||
[logseq.common.util :as common-util])))
|
||||
|
||||
#?(:cljs
|
||||
(defn throw-err
|
||||
@@ -15,20 +14,6 @@
|
||||
[port]
|
||||
`(throw-err (cljs.core.async/<! ~port)))
|
||||
|
||||
#?(:cljs
|
||||
(defn c->p
|
||||
"Converts a Core.async channel to a Promise"
|
||||
[chan]
|
||||
(let [d (p/deferred)]
|
||||
(if chan
|
||||
(async/go
|
||||
(let [result (async/<! chan)]
|
||||
(if (instance? ExceptionInfo result)
|
||||
(p/reject! d result)
|
||||
(p/resolve! d result))))
|
||||
(p/resolve! d nil))
|
||||
d)))
|
||||
|
||||
#?(:cljs
|
||||
(defn drain-chan
|
||||
"drop all stuffs in CH, and return all of them"
|
||||
@@ -87,4 +72,4 @@
|
||||
;; so we stop the whole go-loop
|
||||
(nil? e))
|
||||
(async/close! ch))))
|
||||
ch)))
|
||||
ch)))
|
||||
|
||||
Reference in New Issue
Block a user