mirror of
https://github.com/penpot/penpot.git
synced 2025-05-22 19:36:13 +02:00
📎 Add minor change on how promise is created from observable
This commit is contained in:
parent
44b6d1a516
commit
4faf9bbff1
1 changed files with 12 additions and 9 deletions
|
@ -17,7 +17,8 @@
|
||||||
[app.util.zip :as uz]
|
[app.util.zip :as uz]
|
||||||
[app.worker.export :as e]
|
[app.worker.export :as e]
|
||||||
[beicon.v2.core :as rx]
|
[beicon.v2.core :as rx]
|
||||||
[cuerdas.core :as str]))
|
[cuerdas.core :as str]
|
||||||
|
[promesa.core :as p]))
|
||||||
|
|
||||||
(defn parse-data [data]
|
(defn parse-data [data]
|
||||||
(as-> data $
|
(as-> data $
|
||||||
|
@ -261,14 +262,16 @@
|
||||||
(uuid/next))
|
(uuid/next))
|
||||||
|
|
||||||
(export [_]
|
(export [_]
|
||||||
(js/Promise.
|
(p/create
|
||||||
(fn [resolve _reject]
|
(fn [resolve reject]
|
||||||
(-> (export-file file)
|
(->> (export-file file)
|
||||||
(rx/subscribe
|
(rx/take 1)
|
||||||
|
(rx/subs!
|
||||||
(fn [value]
|
(fn [value]
|
||||||
(when (not (contains? value :type))
|
(when (not (contains? value :type))
|
||||||
(let [[_ export-blob] value]
|
(let [[_ export-blob] value]
|
||||||
(resolve export-blob))))))))))
|
(resolve export-blob))))
|
||||||
|
reject))))))
|
||||||
|
|
||||||
(defn create-file-export [^string name]
|
(defn create-file-export [^string name]
|
||||||
(binding [cfeat/*current* cfeat/default-features]
|
(binding [cfeat/*current* cfeat/default-features]
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue